I'm using EF code first 6.1 and Sql Server 2008 R2 in my project, I enabeled Migrations on my project, when I want to update my Db using Update-database in Package Manager Console I get following error:
Could not load file or assembly 'Microsoft.SqlServer.BatchParser, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
I'm using VS 2013, .NET Framework 4.
Does anyone know where is the problem?
Re-installing SQL Server fixed the problem.
Related
In Visual Studio (2019) I've made an assembly that is using Microsoft.SqlServer.Types, and I compiled it without error messages.
Now I try to import this assembly into my SQL Server (2019) database with T-SQL, but this message appears:
Msg 10300, Level 16, State 2, Line 1 Assembly "MyAssembly" references assembly 'microsoft.sqlserver.types, version=15.100.0.0,
culture=neutral, publickeytoken=89845dcd8080cc91.', which is not
present in the current database. SQL Server attempted to locate and
automatically load the referenced assembly from the same location
where referring assembly came from, but that operation has failed
(reason: another assembly with same SQL name is already present in the
current database). Please load the referenced assembly into the
current database and retry your request.
In SSMS (18.5.1) I see that the microsoft.sqlserver.types that SQL Server is using has a different version: 15.0.0.0.
If I try to remove this from SQL Server before importing the 15.100.0.0 version I get a message saying that deleting is not possible because it is a system assembly.
What is the best I can do now? I am brand new to this stuff.
I am using BLToolKit (ver. 4.3.2.0) and MySql Connector (BLToolkit.Data.DataProvider.MySql.4 of version 4.3.2.0) from NuGet.
When I run my web.app in the mono-environment all work perfectly. But on the IIS I get an exception:
FileLoadException: Could not load file or assembly 'MySql.Data, Version=6.9.7.0, Culture...
What is wrong?
UPD: also I used the MySql.Data (from NuGet), version 6.9.8.0
Just a guess: Is the corresponding assembly in the same folder as your program (should be a library file like "MySql.dll" or "MySql.Data.dll")?
EDIT: This problem has been reported previously:
Could not load file or assembly 'MySql.Data, Version=6.2.2.0
I had the samen problem and resolved it with a copy of the previous version.
- Download the version you need from https://downloads.mysql.com/archives/c-net/
- install the connector on a PC (not the one you are using, it won't install
- copy the folder MySQL Connector Net 6.9.5 from C:\Program Files (x86)\MySQL to the same folder on your PC.
- In Visual studio: remove the MySQL.Data-reference.
- Add the reference again using 'Addreference / Browse'
- Choose MySQL.Data.dll in the folder C:\Program Files (x86)\MySQL\MySQL Connector Net version\Assemblies\v4.5
I am trying to read an xlsx file.
I got exception that
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c#
then I installed it from here
http://www.microsoft.com/en-us/download/details.aspx?id=13255
then I changed the platform target to x64
now i got this exception:
BadImageFormatException was unhandeled
{"Could not load file or assembly 'LinqToExcel, Version=1.9.0.0, Culture=neutral, PublicKeyToken=9c8ea65a58f03f1f' or one of its dependencies. An attempt was made to load a program with an incorrect format."}
Update 1
I already installed the linq_to_excel
using
Install-Package LinqToExcel
and then add the lib files to references
You have two options to solve
Enable IIS to run 32 bits app
Install LinqToExcel_x64
if change 32 bit app in iis From false to true,all conflicts about exteltolinq version solve
Please install Microsoft office in your machine it will automatically solve your problem. It worked for me as well.
I have a SQL Server Database project in Visual Studio 2013. This project refer to another project called BusinessLayer.
BusinessLayer project has reference to System.Component.DataAnnotations and DataAnnotations is in .NET framework dll folder "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll"
I also write a SQL CLR Trigger in DB Project, and when I deploy the database project, I got this error:
SQL72014: .Net SqlClient Data Provider: Msg 6503, Level 16, State 12, Line 1
Assembly 'system.componentmodel.dataannotations, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35.' was not found in the SQL catalog.
I tried to get the public key token of the dll and saw it is same as in the error.
So what is this error and how to solve it?
I'm open to suggestions.
I have a C# Console Application that uses System.Data.DataSetExtensions that I can run smoothly on the client's server through the command line. The only thing I did was to copy the bin/Release directory contents to a specific directory on the server and run the app through the cmd.
Now, I want to run the same app through an SQL SERVER Job. I've tried both the CmdExec and T-SQL options, the latest using xp_cmdshell. I've also tried running the program without the job, just with the xp_cmdshell on a new query tab.
I always get this error:
Unhandled Exception: System.IO.FileNotFoundException: Could not load
file or assembly 'System.Data.DataSetExtensions, Version=3.5.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its
dependencies. The system cannot find the file specified.
Can someone help me to fix this? Why can I run the program through the cmd line and not through Sql Server?
Thx a lot!
Make sure that the database server (where SQL Server was installed) has .NET Framework 3.5 installed.