can not load assembly - json

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/

Related

assembly reference MySql.Data in web.config not working

I'm trying to put an ASP page on my website that accesses a MySql database. The Website project was built in VS2015 and I used MySql.Data dll version 8.0.11.0 (the latest release).
I hosted the website on localhost on the development machine with IIS server. The web.config file has the following assembly reference which was created by VS -
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="MySql.Data, Version=8.0.11.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
</assemblies>
</compilation>
Everything works fine on the development machine, I can access the database, execute queries, etc.
The problem comes when I upload everything to the hosting server. The assembly reference above causes the following error from the parser -
Parser Error Message:
Could not load file or assembly 'MySql.Data, Version=8.0.11.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
I'm thinking that the host server may not have this latest version. Could this be the problem, and if so, how should I reference the MySql.Data assembly?
I have looked all over the web, but cannot find anything very specific, would greatly appreciate any help.
The proposed fix was to paste the MySQL.Data dll in bin folder

could not load file or assembly 'mysql.data, version=6.9.5.0

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.

MySql.Data.dll version in Visual Studio 2010

I have an ASP.Net / c# web application running under framework 4.0, for some years now, using MySQL database.
I have recently being trying to implement reports, and have been trying to use for the first time the automated dataset wizard to create a new DataTable adapter. In running the wizard, I am able to set the datatable adapter and configure the sql statement. I am even able to execute and test it from the visual studio designer. I am also able to create a connection from the Server Explorer tab in Visual Studio and browse the database schema.
When I next try to compile the application, I get the following error:
"Error 1 Failed to generate code. Could not load file or assembly
'MySql.Data, Version=6.6.5.0, Culture=neutral,
PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040) C:\Projects\Sharpview
V2\SharpView V2\App_Code\MCPS\DAL\dsCrewHistory.xsd 1"
Looking in my bin directory, the version I have is 6.4.3.0. Does this mean that I have to download MySQL.Data.dll version 6.6.5.0 and replace it in the bin file? Where can I download this version?
In the visual studio take the reference from the explorer and make sure that the Specific Version is set to false.
If you have an acces to the file web.config make changes to the file and remove version info.
You would need to open the project file with you fav text editor and make sure the version is not mentioned , then remove the line
, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'
Please have a look here and here

Azure: Could not load file or assembly MySql.Data

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.

How do I reference a dll from SSIS in 2012?

I am trying to add a dll reference to my SSIS package (2012) with a script Component. The IntelliSense is working for me and I don't see error when coding. However, I get the following error:
Could not load file or assembly 'XYZ, Version=1.0.0.0, Culture=neutral, PublicKeyToken=XYZ' or one of its dependencies. The system cannot find the file specified.
Please help.
If this is a custom DLL, then you will need to install it into the GAC (global assembly cache) for it to run outside of SSDT.
An assembly cannot be installed into the GAC unless it's strongly signed. Once it's signed, from a Visual Studio command prompt, registration would look like gacutil -if MyRadAssembly.dll