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
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:
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.
Related
When I try to connect MySQL (8.0) database with Visual Studio 2018 I get this error message
"Authentication method 'caching_sha2_password' not supported by any of the available plugins"
Also I am unable to retrieve Database name.
I use mysql-for-visualstudio-1.2.7 and mysql-connector-net-8.0.11 for connection.
Is there any possible way to fix it.
1st
Modify the MySql Server:
Open MySQL Installer - Community
Select Product MySQL Server
Click on Quick configure in last column
Click on next untill you will not point to Authentication method
On Authentication method tab- select Use Legacy Authentication method
Click on next and finish
Now you can login with normal password
2nd
If you are using .net framework 4.5.2
you can easy upgrade reference of MySQL.Data:
Visulastudio> Tools> Nuget Package Manager>Manage nuget package for solution
Go to Browse tab, Write Search textbox mysql and enter
first mysql.data package will come, install it
Now login, issue will resolved
This is a new authentication method used in MySQL version 8.0 as compared to mysql_native_password, which is the legacy method. In order to make this work, you will need to upgrade your MySQL Client library to version 8.0.
So, use the following link and get the version 8.0.11 or higher.
https://dev.mysql.com/downloads/connector/net/
I had the same issue. Fixed it by removing the reference to MySQL.Data then re-adding it.
Update the Pomelo.EntityFrameworkCore.MySql Nuget Package to 2.0.0.1 instead of 2.0.0
2.0.0.1 is more stable than 2.0.0 and 2.0.1
Just update your nuget package for MySql.Data
Our old .NET Framework 4.6.2 project began throwing this exception, when someone came back to using it after we updated MySQL server version few months ago.
So at first, as others recommend, I updated all packages via NuGet Package Manager (including MySql.Data to v8.0.24) - didn't seem to help at first. Then in project properties updated project target framework to .NET Framework 4.7.2 - still nothing.
Then I noticed the connection string had this providerName parameter:
<connectionStrings>
<add name="___" providerName="MySql.Data.MySqlClient" connectionString="server=___;user id=___;password=___;database=___;"/>
</connectionStrings>
so I tried removing the .MySqlClient part from it, leaving it
providerName="MySql.Data"
and for some reason it worked:) Maybe updating the MySql.Data package was part of the solution and the .MySqlClient is some obsolete property. No idea.
Do you hardly need the authentication method in MySQL to be 'caching_sha2_password'? If not, why don't you just switch it to 'Standard'?
You can check this in the "User and Privileges" settings and look for the Authentication Type.
I faced the same error while i was trying to connect my client machine to the Server. I had to connect to MySQL server hosted on the Server. I have got this to working. Followed the following steps:
Download the latest MySQL community version i.e 8.0.18.0 installed. Make sure that the same version of MySQL is installed in the server machine. Please note that either the same version of MySQL are installed in client machine and server machine or else client machine should have higher version of MySQL installed.
With the help of MySQL installer make sure that you installed 'Developer' version in your client machine, so as to have MySQL server, SQL.net, mySQL for visual studio e.t.c all will get installed in it.
We are using .Net framework 4.5.2 in latest MySQL community. So, make sure you using Visual studio 2019. Build UiConfigEDItor source code in Visual Studio 2019 so that it will have support for higher version .Net framework 4.5.
Now, copy all files (mysqlData.dll in particular) from SQL installed workspace(C:\Program Files (x86)\MySQL\Connector NET 8.0\Assemblies\v4.5.2) to Visual Studio 2019 workpace (C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE).
Log off you machine and now open UIConfigEditor source code in visual studio 2019.
Now in Solution Explore->References->Add References->Go to Assemblies tsb-> Extensions->Search for mysql.data.dll(make sure that its there)->check that option.
Please note that mysql.data.dll is of version 8.0.18.0 in this case.
Sometimes, it has a silly reason. In my case, I forgot to create my database in MySQL. Sometimes, one my forgot to run database daemon.
Not every scary error message is because of a scary situation.
All,
I am writing a Powershell cmdlet. Got everything working for the cmdlet on my local machine. Looked at what is needed to access remote machines and it seems I need a reference to Microsoft.Management.Infrastructure.dll in my project. I have search my system to no avail.
So I hit Google. I verified I am running Windows 7 SP1. Downloaded and installed the Windows Management Framework (WMF) 4.0. No luck. Still no DLL. I verified I met the minimum requirements.
I then found a Microsoft page that said version 5 required WMF 4.0 as a prerequisite to the install. So I upgraded my .Net Framework to 4.6.2. Then installed WMF 5.0. Still no .DLL anywhere on my system.
Has anyone experienced this before? Can anyone shed some light as to what I may be doing wrong? I am using Visual Studio 2010. Is this the cause of the problem?
I have continued to search the web and found articles that stated the Microsoft.Management.Infrastructure dll was part of the Windows 7 SDK. Tried installing the SDK with no effect. Still cannot get the dll load on my system.
Continuing to look for a fix.
The easiest way I found to get this dll - and reference it automatically within my VS 2017 Project was via packet Manager console:
Install-Package Microsoft.Management.Infrastructure -Version 4.0.0
As stated here on this Microsoft page: Nuget Gallery
No Need to install any SDK or so only to get this dll.
could you check C:\Program Files (x86)\Reference Assemblies\Microsoft\WMI\v1.0 to see whether can find it there ?
The best resolution I was able to find to this issue after repeated attempts with numerous combinations of .Net frameworks, WMF versions, and Windows 7 SDK's was to install the Windows 8 SDK.
I've just started coding in Visual Studio Code with .NET Core, on Ubuntu 14.04.4
I'm used to both using Ubuntu (from personal interests, hobby, etc) and .NET and Visual Studio at work.
But I've run into a problem i can't seem to overcome. I'm building a small console app that i want to communicate with a MySql Server, but I can't seem to get the MySql.ConnectorNET.Data working properly.
It was installed with the command dnu install MySql.ConnectorNET.Data And that seemed to work fine. The dependency was added in the project.json file, and intellisense was able to traverse the package just fine, but the OmniSharp Log reports that:
[INFORMATION:OmniSharp.Dnx.DnxProjectSystem] Project /home/<username>/VSCode/SimpleSQLatmpt/project.json has these unresolved references: MySql.ConnectorNET.Data
and I simply can't seem to fix that. VSCode seems to detect it, and asks me to run the dnu restore command. But it's to no avail. For all intends and purposes it seems like MySql.ConnectorNET.Data is available in the project, but just can't be used.
Can any one tell me how to fix this?
And just as important, why it is happening in the first place?
Thank you very much for your time.
At the time of this question (Mar 2016) there was no .NET Core-compatible ADO.NET provider for MySQL.
Now situation is changed:
MySqlConnector written by Bradley Grainger -- licensed under MIT, and offers full async support
MySql.Data (>6.10) provided by Oracle (traditionally, GPL)
Personally I prefer MySqlConnector -- it can be used in commercial projects for free (MIT license); also I've tested it with my NReco.Data library under Linux, and it works perfectly in my scenarious. Unfortunately, MySqlConnector doesn't support EF Core yet.
--- UPDATE --
One more .NET Core-compatible MySQL connector + EF Core MySQL provider:
Pomelo.Data.MySql (unfortunately it doesn't implement true async behaviour)
Pomelo.EntityFrameworkCore.MySql
UPDATE 2
MySql Connector NET for .NET Core 1.0 was just released (Sep 2016)
http://insidemysql.com/mysql-connector-net-for-net-core-1-0/
I didn't try Bradley Grainger's connector, but this one from MySQL do not support SSL. :(
So, anybody who wants to use anyway, should connect with ";SslMode=None;" in the connection string.
I have a universal windows store app targeting Windows 10. In a previous version of the app targeting Windows 8.1 I used the LiveSDK (the 5.6 version here) to access data from the user's MS Live account using the LiveAuthClient. In the new version of the app, I figured I'd use the most recent version of the LiveSDK (5.6.3 available as a nuget package here) but when I install the nuget package, I am unable to to access the Microsoft.Live namespace.
For example, the following statement:
using Microsoft.Live;
Produces the error "The type or namespace 'Live' does not exist in the namespace 'Microsoft'"
Is this package broken or am I missing something obvious here? I would have expected this to work just like it did with the 5.6 version of the LiveSDK. It also seems like the documentation for the LiveSDK is all pointing to info about the OneDrive api now so it makes me wonder if the purpose of the sdk has changed. I'm confused... What's the most recent version of the LiveSDK (the one that has the LiveAuthClient) and where can I find it?
I'm not sure why Nuget Manager doesn't add a reference automatically, but it seems to work once you add a reference manually from directory:
C:\Users\USER\.nuget\packages\LiveSDK\5.6.3\WindowsXAML\MicrosoftLive.dll.
I'm trying to get SQLite working in a Universal Windows App targeting UAP v10 using Visual Studio 2015 (RTM).
I've installed the Visual Studio Extension, "SQLite for Universal App Platform" and referenced it (and "Visual C++ 2015 Runtime for Universal Windows Platform Apps") from my project.
I've then added System.Data.SQLite via NuGet, which appears to work as a reference to it gets added to my project and I don't see any error messages. However, I don't appear to get any DLLs added to my project through this process.
Upon further investigation, it looks as though the System.Data.SQLite NuGet package is actually empty, but lists the following as dependencies...
System.Data.SQLite.Core
System.Data.SQLite.Linq
System.Data.SQLite.EF6
So - I tried adding each one of these through the Package Manager Console and received the following error...
Install-Package : System.Data.SQLite.Core 1.0.98.1 is not compatible
with UAP,Version=v10.0.
This seems like a fairly conclusive error message. So what do I do now... is SQLite actually supported for Windows 10 Universal Apps at the moment or not? Documentation I can find on the web seems pretty contradictory or at least seems to imply that I should be able to do what I'm trying to do.
Any help / pointers would be appreciated!
Win10 UWP(UAP) and Win8.1/WP8.1 Store App does not support ADO. System.Data.SQL is an ADO provider, then it's not applicable for UWP, I believe.
To using SQLite on UWP, you need to have SQLite itself and wrapper for .NET.
SQLite - SQLite (Visual Studio Extension)
SQLite wrapper for .NET (NuGet) - SQLite.Net-PCL
or SQLite.Net.Async-PCL
And, following link may helps you. It's a VB guy's blog =) but very insightful for uwp works.
Win10 apps in .NET - references
Edited 7 Feb 2017: Windows 10 Anniversary Update(1607) support the SQLite as "Microsoft.Data.SQLite".
Using SQLite databases in UWP apps - Windows blog
Looks like Microsoft is building a version. As of this comment, they are in release candidate 1.
https://github.com/aspnet/Microsoft.Data.Sqlite
go to http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki and download the right installer for the .net framework youre using.
this will register the dll's for you and give you everything you need
Since the Windows 10 Anniversary Update (Build 14393), SQLite has also shipped as part of the Windows SDK
This link explains everything:
https://blogs.windows.com/buildingapps/2017/02/06/using-sqlite-databases-uwp-apps
SQLite is supported for Universal Windows platform.
C# solution
Install SQLite for Universal Windows Platform Visual Studio extension.
Use SQLite C# API Wrapper Microsoft.Data.SQLite. More information here.
C# or C++/CX solution
Install SQLite for Universal Windows Platform Visual Studio extension.
Add reference to SQLite for Universal Windows Platform extension to your project:
Project => References => Universal Windows => Extensions => SQLite for
Universal Windows Platform
Write your own wrapper using low-level SQLite API in C# or C++.
C++/CX solution
This SQLite-WinRT wrapper is handy for UWP apps written in C++/CX.