Visual Studio 2015 not installing Mysql.data in NuGet - mysql

UWP App not being able to work with MySql
I have made an app in UWP and instead of using SQLLite which seems to be the norm for Visual Studio 2015 I want to use MySql. I have already connected my Azure mysql database to Visual Studio via the 'Server Explorer'.
I'm using MySQL Workbench to update my tables within my connected database from Azure but I cannot actually write any code to access my tables as whenever I try to install MySql.data/.entity/etc in the NuGet Package Manager I get an error.
nuget error
I tried downloading the Mysql installer, the Mysql drivers for Ado and ODBC. I even tried downloading the MySql for Visual Studio option as I found out that Visual Studio is not compatibile with MySql and instead requires the MySql for Visual Studio download but I still have errors whenever I try to use MySql in my code as I need an assembly reference for it but I'm having no luck in being able to get one that doesn't error.
Does anybody have any idea how I could actually use MySql within Visual Studio 2015?
This is what I've been using as my guideline but I can't seem to get past the Mysql.data errors when installing.
http://web3.codeproject.com/Articles/1074242/Designig-your-Azure-MySQL-DB-with-a-UWP-Demo
I have seen a lot of people talk about this but there is no one straightforward fix (I've tried a lot of the fixes, one in particular being to use Vs13 to install Mysql in the Nuget package manager and then it should update within VS15 but as my app is a UWP VS13 does not actually load/read it so that idea isn't good to me, might help anyone else though)

Starting with 6.7, Connector/Net fully supports building Windows Store apps. But using Connector/Net RT is not by install the Nuget package, it just reference the MySql.Data.RT.dll assembly according to MySQL Connector/Net Developer Guide:
Using Connector/Net RT is easy. Simply create a Windows Store application using Visual Studio and then reference the MySql.Data.RT.dll assembly in your project. The code you write should be exactly the same as for normal Connector/Net (including using same namespace MySql.Data.MySqlClient) except for the differences listed above.
You may find this dll at C:\Program Files (x86)\MySQL\Connector.NET 6.79\Assemblies\RT if you have install the connector. You can also download the mysql-connector-net-6.7.9-noinstall.zip to find this file inside the folder. I also have a MySql UWP sample before and has the dll here. Right click your project and add reference for this it will work.
More details please reference this sample

Related

Failed to open a connection to the database; MySQL.Data.MySQLClient; Cannot create a design window for the selected object

I am using
Visual studio 2017, version 15.9.11
MySQL for visual studio 1.2.9
MySQL-8.0.18-win64
mySQL-connector-net-8.0.18-noinstall
If I try to add a connection to a project via Data Sources > Database > Dataset, and set the connection with the right server name, user name, and password, and then select one table, select options and click Next I get the following error
"Failed to open a connection to the database Cannot obtain
provider factory for data provider named 'MySql.Data.MySQLClient'.Check the connection and try again."
Also, when I connect to a local MySQL database using Tools > Connect to database... and I create the connection, which successfully seems to be done in the server explorer, and then in the same server explorer panel, if I go Data Connections > localhost > tables > double-click on the table, this is the error I get:
Cannot create a design window for the selected object.
How can I solve this?
The problem
As I said in my question I had mysql-connector-net-8.0.18-noinstall extracted. I tend to extract binaries instead of installing things. Don't really have a good reason for this behavior.
After checking Vignesh solution and before uninstalling anything, I decided to give a try to the mysql-installer-community-8.0.18.0.msi installer, since I had the mysql-connector-net-8.0.18-noinstall extracted in one folder and then I added a reference in the project, which was not working. Perhaps there was a way to use this folder (binaries, global references, etc) properly, but I couldn't find one. Maybe I was the problem.
The solution
However, after installing via the msi file, everything is working now. So if you ran into this problem, having similar versions than the ones I'm using and had the no-install version extracted, you can safely close Visual Studio, and install the same version via the msi installer, this worked for me! Worst case scenario, you can uninstall it via the same msi file, and try Vignesh's or other's solution.
This error will be fixed by uninstalling Connector current version and installing Connector 6.9.8
Download Connector 6.9.8
Visual Studio 2015: Visual Studio 2015 Community + DotNet Connector 6.9.8 + MySQL for Visual Studio 2.0.3 is working combination.
Visual Studio 2017: Visual Studio 2017 Community + DotNet Connector 6.9.8 + MySQL for Visual Studio 1.2.7 is working.

MySQL Data Source Not Showing Up In Visual Studio 2015

As the title says, no matter what I do MySQL does not appear in the list of Data Sources in Visual Studio 2015.
I have done everything that is suggested in this question: MySQL Data Source not appearing in Visual Studio
I have also installed development releases and different versions of connectors with the corresponding MySQL VS drivers as per this table here: https://dev.mysql.com/doc/visual-studio/en/visual-studio-install.html
I have reinstalled Visual Studio itself.
All of this to no avail. I can manually configure the connection and run a .Net application that reads from and writes to MySQL but Visual Studio refuses to do anything with MySQL in the data source popup window.
Short of moving the database to SQL Server I am not sure what else can be done here.
Any suggestion or help to get this resolved would be great. I've been at this for the last 48 hours.
Currently installed versions: MySQL for Visual Studio - 1.2.7, Connector/Net - 6.9.9
This is for a .Net 4.5.2 based project.
I have had this same problem a while back. Unfortunately I think the answer is case by case, and I can't remember what exactly fixed it other than playing around with versions of MySQL Server and MySQL Connector/Net versions.
I have VS 2015 so I just tried to recreate this problem. I was unable to do so as I installed MySQL for VS 1.2.7 and Connector/Net 6.9.9 and was able to see MySQL Database as an option in the Data Sources window.
I recommend uninstalling both MySQL for VS and your Connector/Net 6.9.9 and then reinstalling them. Make sure you install MySQL for VS before Connector/Net as the documenation you linked in your question says "Always install MySQL for Visual Studio before installing MySQL Connector/Net."
You might also try using MySQL community server instead of MySQL for VS and using an older version of Connector/Net.
Update
Try doing the following:
Uninstall MySQL for VS and Connector/Net.
Install Connector/Net 6.9.9 by doing a custom installation. Remove the Web providers feature from the installation and continue with installation.
Install MySQL for VS 1.2.7 by doing a custom installation. Make sure that the Visual Studio Integration feature is selected for installation and finish installation (It should be selected by default).
Update 2
If you want more alternatives to reinstalling:
Try checking out your machine.config file properties to see if the MySQL Data Provider property is similar to mine by going to C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG
Lines to check:
ltsadd name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=XXXXXXXXX" /gts
Also, maybe try a creating a website instead of a project or vice versa. There are multiple ways to get to the Data Source window. You could try creating an ADO.Net object and adding a connection to see if that data source window displays MySQL as a data source. You can also create a connection through the server explorer window. Just follow these steps.
Install the last NuGet version of:
MySql.Data
MySql.Data.Entity
Close and re-open visual studio
Choose ADO Entry Data Model
New Connection
On the right of data source, edit button
On the new window you will find MySQL Database

Visual studio 2012 connect to MySQL server [duplicate]

I've been reading about mySQL DataSource and the ability to use mySQL with Entity Framework, but I can't really generate EF with mySQL without the use of the DataSource Dialog
How can I add mySQL Database to such dialog?
This is what I have done so far:
Installed mySQL Connector v.6.5.4
Restarted n-times my Windows 7 machine
Read all about how well mySQL Connector works on previous versions of Visual Studio
I have just read from mySQL Forums that mySQL will ship Visual Studio 2012 integration with mySQL Connector v.6.5.5
We'll be adding support for VS 2012 in Connector/NET 6.5.5 and later 6.6.x version
http://forums.mysql.com/read.php?38,546265,564533#msg-564533
and give a link to test a trick
http://social.technet.microsoft.com/wiki/pt-br/contents/articles/10476.instalando-mysql-connector-no-visual-studio-2011-beta.aspx
and here is the vsix file if you follow the tutorial (In Portuguese)
Microsoft Visual Studio Extension for mySQL: http://cl.ly/JqXO
just download and double click...
then, you will get all to work
Using Visual Studio 2012 Professional
One clarification: Visual Studio Express DOES NOT support MySQL .NET Connector as extension.
You still may use it adding reference to MySql.Data.dll file that you may find in MySQL Connector installation folder (for me it was W:\Program Files\MySQL\Connector NET 6.5.4\Assemblies\v4.0).
After that you may use it like this:
using MySql.Data.MySqlClient;
...
var mycon = new MySqlConnection();
According to this page: http://dev.mysql.com/downloads/connector/net/
"Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration. That functionality is now available in a separate product called MySQL for Visual Studio available using the MySQL Installer for Windows (see http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html)."
Visual Studio 2012 is not yet supported by MySQL Connector v.6.5.4. You can't add a connection to MySQL in the Server Explorer to begin with.
According on this post, support will be added on MySQL Connector v.6.5.5
Connector/NET 6.5.5 does not support VS2012, but Connector/NEt 6.6.x does.
However Visual Studio Express editions are not supported, hence the only way to work in Entity Framework and Visual Studio Express and MySql (or other database different than SQL Server for that matter) is using code first.
It wouldn't matter if you had the MySQL driver showing as far as I can tell. I'm running VS 2012.3 and if I try to create a Data Connection in VS Server Browser, I can get as far as selecting the MySQL driver and no more. If I try typing a servername/username/password (any of the fields), the window just disappears and YES, it's only when the MySQL driver is being used so NO it's not vs (not exclusively) causing the problem. Go ahead and say that it's my environment but you'd not be able to justify that even remotely compared to the FACT of what is happening. ALL my other software/extentions/add-in/libraries work just fine. No surprise either seeing how buggy the "3 minute" Windows Installer was. Had to uninstall/reinstall a server instance to get to the configuration wizard and there is no other apparent way to configure an instance without it. I'd rather have the old setup. /rant
Downloaded and install Download MySQL for Visual Studio http://dev.mysql.com/downloads/windows/visualstudio/1.1.html

mySQL DataSource on Visual Studio 2012

I've been reading about mySQL DataSource and the ability to use mySQL with Entity Framework, but I can't really generate EF with mySQL without the use of the DataSource Dialog
How can I add mySQL Database to such dialog?
This is what I have done so far:
Installed mySQL Connector v.6.5.4
Restarted n-times my Windows 7 machine
Read all about how well mySQL Connector works on previous versions of Visual Studio
I have just read from mySQL Forums that mySQL will ship Visual Studio 2012 integration with mySQL Connector v.6.5.5
We'll be adding support for VS 2012 in Connector/NET 6.5.5 and later 6.6.x version
http://forums.mysql.com/read.php?38,546265,564533#msg-564533
and give a link to test a trick
http://social.technet.microsoft.com/wiki/pt-br/contents/articles/10476.instalando-mysql-connector-no-visual-studio-2011-beta.aspx
and here is the vsix file if you follow the tutorial (In Portuguese)
Microsoft Visual Studio Extension for mySQL: http://cl.ly/JqXO
just download and double click...
then, you will get all to work
Using Visual Studio 2012 Professional
One clarification: Visual Studio Express DOES NOT support MySQL .NET Connector as extension.
You still may use it adding reference to MySql.Data.dll file that you may find in MySQL Connector installation folder (for me it was W:\Program Files\MySQL\Connector NET 6.5.4\Assemblies\v4.0).
After that you may use it like this:
using MySql.Data.MySqlClient;
...
var mycon = new MySqlConnection();
According to this page: http://dev.mysql.com/downloads/connector/net/
"Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration. That functionality is now available in a separate product called MySQL for Visual Studio available using the MySQL Installer for Windows (see http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html)."
Visual Studio 2012 is not yet supported by MySQL Connector v.6.5.4. You can't add a connection to MySQL in the Server Explorer to begin with.
According on this post, support will be added on MySQL Connector v.6.5.5
Connector/NET 6.5.5 does not support VS2012, but Connector/NEt 6.6.x does.
However Visual Studio Express editions are not supported, hence the only way to work in Entity Framework and Visual Studio Express and MySql (or other database different than SQL Server for that matter) is using code first.
It wouldn't matter if you had the MySQL driver showing as far as I can tell. I'm running VS 2012.3 and if I try to create a Data Connection in VS Server Browser, I can get as far as selecting the MySQL driver and no more. If I try typing a servername/username/password (any of the fields), the window just disappears and YES, it's only when the MySQL driver is being used so NO it's not vs (not exclusively) causing the problem. Go ahead and say that it's my environment but you'd not be able to justify that even remotely compared to the FACT of what is happening. ALL my other software/extentions/add-in/libraries work just fine. No surprise either seeing how buggy the "3 minute" Windows Installer was. Had to uninstall/reinstall a server instance to get to the configuration wizard and there is no other apparent way to configure an instance without it. I'd rather have the old setup. /rant
Downloaded and install Download MySQL for Visual Studio http://dev.mysql.com/downloads/windows/visualstudio/1.1.html

WiX installing SQLServerSpatial.dll and SQL Server 2008 R2?

We're trying to update our WiX installer to install SQL Server 2008 R2. Regular 2008 seemed to install fine on most machines, but the R2 install seems to fail to install SQLSysClrTypes - so we hit an error with a missing dll called SQLServerSpatial.dll.
Is there a way to get the SQL installer to correctly install this? I have found some discussions of this issue online but no solutions, except for manually installing SQLSysClrTypes.msi after SQL Server.
We want the install to be silent and need the minimum of user interaction.
We're using WiX 3.5 & VS2010.
Edit
Further reading and thinking leads me to understand that SQL 2008 SP1 didn't install SQLServerSpatial.dll either, and it is changes to our code which have made this a requirement now. So my question has become simplier:
Can I configure the SqlServer install to include/install SqlServerSpatial?
or
Can I use WiX to install SQLSysClrTypes.msi (I would need the package.xml and product.xml)? Has anyone done this?
While I am unsure about the changes to SQL Server and why SqlServerSpatial.dll is missing, I can answer with regards to installing prerequisites using a bootstrapper.
Can I use WiX to install SQLSysClrTypes.msi (I would need the package.xml and product.xml)? Has anyone done this?
It sounds like you are using the visual studio bootstrapper. You can use the bootstrapper manifest generator tool to create the bootstrapper manifest (package.xml and product.xml) so that you can create a bootstrapper like you would for other prereqs (for example, the .NET framework).
Of course, if you are open to upgrading to WiX 3.6 (still in beta but pretty stable), you may use the new bootstrapper functionality called Burn to create package bundles in order to chain your packages together.