0

I am using Visual Studio 2015 the community version. When I try to add the MySQL Connector in the references it will fail even when I try to add it via NuGet Packages it still fails.

I have tried searching the web for solutions but I kept getting the same result, failure. I have no idea where to get a .NETCore version of MySQL Connector.

Here is my error
Example

ZORRO
  • 528
  • 3
  • 13
Mario
  • 38
  • 1
  • 5

2 Answers2

2

As your exception image suggested, the error is clearly:

The project targets '.NETCore' while the file reference targets '.NetFramework'. This is not a supported scenario.

To see the difference between them, you can refer to the answer here: How does Windows 8 Runtime (WinRT / Windows Store apps / Windows 10 Universal App) compare to Silverlight and WPF? [closed].

For the MySQL Connector for WinRT, you can refer to Chapter 7 Connector/Net Support for Windows Store.

Just tested, you can download mysql-connector-net-6.7.9.msi here, if your device has installed higher version of connector like 6.9.9, you probably need to remove it and install this 6.7.9 version. (Don't know why, as my test result, it seems 6.9.9 doesn't have MySql.Data.RT.dll, didn't look into it, it is possible that I didn't install it correctly, anyway 6.7.9 works for me.)

Then you can find the MySql.Data.RT.dll in your MySQL connector installed path for example: C:\Program Files (x86)\MySQL\MySQL Connector Net 6.7.9\Assemblies\RT, and for UWP app, you can reference this .dll file successfully:

enter image description here

Community
  • 1
  • 1
Grace Feng
  • 16,564
  • 2
  • 22
  • 45
  • Thanks a lot for the reply! i decided to use a server via sockets to use MySql so its a bit of a challenge and to keep it fun working on my project :D. – Mario Nov 06 '16 at 16:21
0

You should follow this guide and install proper .NET Core Connector.

http://insidemysql.com/mysql-connector-net-for-net-core-1-0/

To achieve this, you should use Package Manager Console and follow the guide above.

Let me know if it works for you.

PWNTech
  • 36
  • 3
  • Thanks a lot for the reply! i decided to use a server via sockets to use MySql (the version i like the most). – Mario Nov 06 '16 at 16:18