I'm trying to call a MySQL database located on another server, from Azure.
I'm referencing .Net MySql.Data, and it works when running it in a test application.
However when I deploy the code to the Azure server I get the following exception:
Could not load file or assembly 'MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Since it's part of .Net I would expect it to work on Azure so I suspect I may be doing something wrong.
I also tried adding the MySql.Data.dll to the project and installing it to the CAG with no luck. (However I'm not certain it was installed successfully)
Any help or advice would be much appreciated.
Why are you assuming MySql.Data is part of .NET? The connector was written in .NET, it's not part of .NET. You will need to make sure the assembly is available in your instances. Since copy local didn't work (it should work...), try the following:
Add both gacutil.exe and MySql.Data.dll in a folder (mysql for example) in your project and set Copy to Output Directory to always.
Then create a startup task that calls gacutil.exe and installs the assembly, something like: mysql\gacutil.exe /i mysql\MySql.Data.dll
Note: I'm assuming you're using a Web Role.
Related
I'm using the CodePlex-hosted Microsoft.SqlServer.IntegrationServices.Build project to build a DLL that contains the MSBuild tasks for building SSIS packages via MSBuild.exe.
I also am using an MSBuild proj file that's floating around the web.
More here:
https://speaksql.wordpress.com/2013/06/07/a-journey-to-db-deployment-automaton-ssis-build-using-msbuild/
I've opened the CodePlex project, disabled signing, switched it to 4.6.1 and built the DLL and corrected paths etc. and go it semi-working. However MSBuild spits this error:
Could not load file or assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
I've installed SSDT latest for Visual Studio 2015. I have various SQL Server editions installed on my dev PC. The DLL seems to be present; I've copied all I need into one folder for the moment.
Open the CodePlex project again and remove the reference to Microsoft.SqlServer.ManagedDTS.
Look on your local disk for the missing Microsoft.SqlServer.DTSRuntimeWrap.dll and note the version(s) you have available.
Now look on your disk for Microsoft.SqlServer.ManagedDTS.dll and note the version(s).
Re-add the reference but make sure you pick a DLL for which you also have the version of the 'wrap' available.
Now make sure those DLLs are (re)copied over into your working folder or whatever.
If you're still having problems, you may need to copy some files around so that MSBuild.exe can find them or edit/create a config file for MSBuild.
How to solve: Custom MSBuild task requires assembly outside of AppBase
I am working on C#, 2012 visual studio project. when I copy my project to another computer and try to run it, it throws the following error:
Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system can not find the file. calling assembly: Coolite.Ext.Web .dll
I downloaded Newtonsoft.Json, Version=3.5.0.0 and referenced it in the project still the same error. I have also tried to redirect it using runtime redirection in the web.config, still no hope.
Make sure you target the proper framework in VS.
https://msdn.microsoft.com/en-us/library/bb398202(v=vs.110).aspx
Also make sure you're getting it from NuGet to ensure you have the most up to date version
https://www.nuget.org/packages/Newtonsoft.Json/
I'm having a issue with a Visual Basic 2013 program I made (in vb.net) and the issue is with MySQL.data.dll, I've tried changing copy local to true in the GAC, I've tried upgrading my MySQL.data.dll to the most recent version but whatever I do it only works if the MySQL.data.dll folder is in the same folder as the executable when running it.
(Do note that this error only occurs on other machines, not my machine)
This is the error exactly:
[Could not load file or assembly 'MySql.data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.]
Please help, I don't want to have my users have to put MySQL.data.dll in a file with the exe just to be able to run it (for obvious reasons.)
Check the version of the MySQL assembly against the versions appearing in the compiler output.
Do not use the error list look at the Output window and select Build from the drop down and look for errors.
The most probable cause is your application is linked to specific (possibly multiple) versions of MySQL, and there is a conflict on the specific version of MySQL referenced. You might also want to change the specific version property of the assembly reference...
How exactly does the "Specific Version" property of an assembly reference work in Visual Studio?
asp server error ' Could not load file or assembly ' but the assembly is definitely there.
It's pretty simple. You need to make sure the reference to the assembly is correct. I'd avoid installing MySQL into the GAC. Don't install the MSI, if you have uninstall it, then download the zip archive
mysql-connector-net-6.9.5-noinstall.zip
Extract the files to a folder reference those assemblies in your solution. If you're using source control check the folder containing the MySQL assemblies into source control, with the rest of the solution.
If you have more than one assembly referencing MySQL you should check that they are all referencing the same version, from the same location and/or have the "Specific Version" property set to false and "Copy Local" set to true.
I am trying to deploy my web service on AppHarbor through GitHub. My web service is using NHibernate.Spatial, which has Microsoft.SQLServer.Types version 10.0.0.0 as a dependency. This assembly is, if I understand correctly, installed along with SQL Server 2008. When I run my web service on my development computer, on which I have SQL Server 2008 installed, the service runs without trouble, but when I deploy to AppHarbor I get the following exception:
"Could not load file or assembly 'Microsoft.SqlServer.Types,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or
one of its dependencies. The system cannot find the file specified."
As I already build my own version of NHibernate.Spatial.MsSql2008, the assembly from which the dependency derives, I have simply tried copying the required dll into the bin folder when building this project, by setting the reference property Copy Local to true. This is also reflected in the web service bin folder which is pulled by AppHarbor through Git. This didn't help though and my guess is that my web service is looking for the dependency in a different folder than bin.
How do I make the Microsoft.SqlServer.Types assembly available on AppHarbor? As the exception states, this might also be caused by possible missing dependencies of Microsoft.SqlServer.Types, but how do I find if this is the case, and again, how do I make the dependencies of Microsoft.SqlServer.Types available on AppHarbor?
Here's a NuGet package with the Microsoft.SqlServer.Types assembly. You can use this in combination with NuGet package restore on AppHarbor.
I am trying to deploy a solution on a Mono Hosting Service, and I would like to use the MySql connector...
The problem is that I can't use the MySql connector, it says:
Could not load file or assembly 'MySql.Data, Version=6.2.2.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D' or one of its dependencies. The system cannot find the file specified
I don't understand why? the file is in the bin directory!? what could be the reason for this?
Linux is case sensitive, so rename "mysql.data.dll" to "MySql.Data.dll".
Most hosting programs have their own library search path. Perhaps you have to add the MySQL connector to the hosting program's library search path.
e.g. In Tomcat you have to modify the CLASSPATH set in the Tomcat startup script, I'm sure the mono hosting service has something similar.
EDIT: It looks like mod_mono has a MonoPath variable that can be set to include external assemblies. Details here.