Could Not Load File Or Assembly 'System.Data.SqlServerCe, Version 126.96.36.199
May 8, 2008
We just upgraded our applications from VS 2005 to VS 2008 and discovered we had to convert our SQL Server CE databases. So I did that. I then included the sqlce...35.dlls in the application directory on my test computer as well as the System.Data.SqlServerCe.dll version 3.5.
When I run the app and it tries to load the System.Data.SqlServerCe.dll I get the following error:
System.IO.FileLoadException: Could not load file or assembly 'System.Data.SqlServerCe, Version 188.8.131.52...or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
We have the application targeting the .NET Framework 2.0 and need to keep it that way for awhile.
I am trying to use SQL Mobile 2005 with Visual Studio 2005. I have a simple sql mobile db i created and am trying to test connectivity to the DB in a simple app. I added the reference to the SqlServerCE and the verison # that is shown in properties is 3.0.3600.0, but when i look at the physical DLL in explorer (found at C:Program FilesMicrosoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev3.0) the version # is 3.0.5206.0, so when i compile and run the test, I get :
I am trying to make a mobile application work, but I get the following error. The operating system on Pocket PC is Microsoft® Windows Mobile„¢ 2003 Second Edition. Any ideas? Thanks in advance.
The followings are the error and my codes:
System.TypeLoadException was unhandled Message="Could not load type 'System.Data.SqlServerCe.SqlCeDataAdapter' from assembly 'System.Data.SqlServerCe, Version=184.108.40.206, Culture=neutral, PublicKeyToken=89845DCD8080CC91'." StackTrace: at SQLMobile.Form1.Form1_Load() at System.Windows.Forms.Form.OnLoad() at System.Windows.Forms.Form._SetVisibleNotify() at System.Windows.Forms.Control.set_Visible() at System.Windows.Forms.Application.Run() at SQLMobile.Form1.Main()
Private Sub FillGrid()
Dim filename As New String _
Dim conn As New SqlCeConnection("Data Source=" + filename)
Dim selectCmd As SqlCeCommand = conn.CreateCommand()
selectCmd.CommandText = "select Destination from flightdata"
I have an application broadly deployed (about 10 computers). As of yesterday, two of these computers are unable to start the application, and failing with the error below. All other computers run the application just fine.
System.IO.FileNotFoundException: Could not load file or assembly 'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I checked and ADODB.dll version 7.0.3300.0 is in the GAC in the deployment target machines.
I find ADODB.dll in my C:Program FilesMicrosoft.NETPrimary Interop Assemblies folder (development computer), but this is version 7.10.3077.0 (file properties version)
I see ADODB.dll as a project reference, but this shows version 7.0.3300.0, and shows the path to the PIA folder. I have no clue why these are not showing the same version number. Local Copy is false.
Installing MDAC 2.8 on the failing deployment target machines did not help.
I have developed an application in C#, and it uses both a SQL server database, and as part of its operation it opens up a Foxpro database. I am using Odbc to connect to the fox pro database and everything wortks just fine on my devleopment machine. However when I deploy my application I am getting the following error text when ever I create the form that does the Odbc work.
************** Exception Text ************** System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Odbc, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Data.Odbc, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
I have absolutely no clue why I am getting this error. I have insured that the latest MDAC was installed ( it is XP Pro so no updates there ) I have made sure that I have the latest Fox Pro Odbc driver installed as well and I can create the DSN just fine.
Can anyone point me where to look next ? Im truly stumped here.
TITLE: Connection Manager ------------------------------ Test connection failed because of an error in initializing provider. Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its dependencies. The system cannot find the file specified.
This happens whenever I press "Test Connection" button in the Connection Manager dialog. I'm wondering if this has something to do with the installation of the .NET Framework. I'm using a new machine and so far I havent had any problem with .NET applications. Do I need to add this assembly somewhere?
The VB code was complied into a DLL called totalmem.dll and call following TSQL to map it into a SQL function:
create assembly totalmem from '!WORKINGDIR! otalmem.dll'
create function fnGetTotalMem()
as external name totalmem.SqlClrVB.GetTotalPhysicalMemory
When I call this function, it returned following error:
Msg 6522, Level 16, State 2, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'fnGetTotalMem':
System.IO.FileNotFoundException: Could not load file or assembly 'System.Web, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Anyone knows why I'm hitting this error? I didn't reference any System.Web interface why it needs to load System.Web assembly? The same code runs OK if I compile it as a separate VB application out side of SQL Server 2005.
I believe I've encountered a compatability problems with Visual Studion CF 2, specifically with the System.Data.SQLServerCE reference when trying to run (in debug mode - Pocket PC 2003 emulation). The environment is configured as follows:
Visual Studio 2005 - Compact Framework 2.0.50727
Microsoft SQL Server 2005 Mobile Edition
The (VB) project includes the following references:
System.Data.dll V2.0.000 from Program FilesMicrosoft Visual Studio 8Smart DevicesSDKCompact Framework2.0V2.0WindowsCE
System.Data.SqlServerCE.dll V3.0.5214.0 from Program FilesMicrosoft SQL Server Mobile EditionDeviceMobileV3.0
The IDE does not sense any problems with the following code until I try to run it in debug mode using the Pocket PC 2003 emulator. The code :
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("Will Test SQL")
Private Sub testSQL()
Dim strConn As String = "Data Source = Test.sdf; Password = <password>"
In the debugger, the program terminates at Dim CEEngine As New SqlCeEngine(strConn). The message displayed is
Can't find PInvode DLL 'sqlceme30.dll'
I've tried referencing a different version of System.Data.SqlServerCE.dll (from Program FilesMicrosoft SQL Server90ToolsBinnVSShellCommon7IDE but the program will not even deploy to the emulator with this reference.
I encounter a Deployment/and or registration failed wit error : 0x8973190e - There is not enough space on the disk.
I've inherited a .NET CF 2.0 application at work that uses SQL CE, and as I'm digging into the build process, I'm getting confused about which version of SQL CE that is being used.
The project references System.Data.SqlServerCe (no hint path, just from wherever VS 2005 has it). When I look at the assembly in my project, the version shows up as 3.0.3600.0, but when I browse to the DLL's location on my hard drive (C:Program Files (x86)Microsoft Visual Studio 8SmartDevicesSDK\SQL ServerMobilev3.0System.Data.SqlServerCe.dll), right click the DLL and check the properties, the version shows up as 3.0.3600.0.
In our installation package, we install three SQL CE Cabs: sqlce30.dev.ENU.ppc.wce5.armv4i.CAB sqlce30.ppc.wce5.armv4i.CAB sqlce30.repl.ppc.wce5.armv4i.CAB
When installed on the device, the Remove Programs dialog shows as "Microsoft SQL Mobile 2005..." is installed. We keep the cabs in a seperate location so they are not just pulled from anywhere on the hard drive.
However, when I install the same CAB files located at: C:Program Files (x86)Microsoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev3.0wce500armv4i, the device shows "Microsoft SQL Mobile 2005 Compa...." is installed.
In my Add References dialog, System.Data.SqlServerCe has version 3.0.3600.0, runtime v2.0.50727
Some questions: 1. Is the version 3.0.3600.0 the same between 3.0 and 3.1? 2. Given a System.Data.SqlServerCe DLL, how can I tell if it is the 3.0 or 3.1 version? 3. When upgrading my project to use 3.1, is it enough simply to upgrade my build environment? Or should I need to change the references in my project? (It appears that the 3.1 DLLs have been placed into the default locations where VS 2005 is pulling them from). I'm using VS 2005 SP1 on Vista x64.
I try backup database but this error message pop up: could not load file or assembly 'SqlManagerUi, Culture=neutral, PublicKeyToken= 89845dcd 8080cc91' oe one of its dependencies. Method signature has invalid calling convention. (Exception from HRESULT: 0x80131239)(mscorlib)
I am receiving the following message when I try to create an SSIS project in Visual Studio 2005 Team Suite:
Could not load file or assembly "Microsoft.AnalysisServices.Controls" Version=18.104.22.168, Culture=neutral, Public Key Token = 89845dcd8080cc91 or one of it's dependencies. Strong name validation failed (Exception from HRESULT: 0x8013141A)
I have downloaded the project from http://mattberseth.com/blog/2007/10/theming_the_ajaxcontroltoolkit.html. When i built and run athe application i get the error
Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. C:Documents and SettingsJingaMy DocumentsVisual Studio 2005Projectscalendar_themeweb.config 30
I am attempting to create a program that will run on the PocketPC 2003 environment. I have upgraded Visual Studio to SP1, I have installed SQL Server Compact Edition on my development machine and I have installed SQL Server Compact Edition Tools For Visual Studio on the development machine.
I have created a new project Visual Basic - Smart Device - Pocket PC 2003. I have created a form for user input. I build and deploy the form to the Symbol Pocket PC to test - no connection to data and it works.
I then add a reference to System.Data.SqlServerCE.dll and rebuild and redeploy the application to the handheld. When I attempt to open the form I receive the following error:
at System.Resources.ResourceReader.LoadObjectV2() at System.Resources.ResourceReader.LoadObject() at System.Resources.RuntimeResourceSet.GetObject() at System.Resources.ResourceManager.GetObject() at System.Resources.ResourceManager.GetObject() at pmsPocket.frmSetSOPType.InitializeComponent() at psmPocket.frmSetSOPType..ctor() at System.Reflection.RuntimeContructorInfo.InternalInvoke() at System.Reflection.RuntimeContructorInfo.InternalInvoke() at System.Reflection.ContrcutorInfo.Invoke() at System.Activator.CreateInstance() at MyForms.Create__Instance__() at MyForms.get_frmSetSOPType() at psmPocket.SetSOPType.Main()
Now the confusing part is that I haven't changed any of the forms or the code behind the forms, I have simply added the reference to the project.
Any idea why adding the reference to System.Data.SqlServerCE.dll would cause the system to start generating these errors?
I've checked, the install process has loaded the .NET 2 framework to the handheld. And as indicated at the beginning of this message, the application showed the form prior to my adding the reference.
I'm using SQL Server Compact Edition, but in the future I would like to be able to switch to another SQL Server Edition or even a different database. To achieve this, Microsoft recommends using DB Provider Factories (see: Writing Provider Independent Code in ADO.NET, http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=674426&SiteID=1).I enumerated the available data providers on my PC with:
The important entry is:"SQL Server CE Data Provider"".NET Framework Data Provider for Microsoft SQL Server 2005 Mobile Edition""Microsoft.SqlServerCe.Client""Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=22.214.171.124, Culture=neutral, PublicKeyToken=89845dcd8080cc91"When executing:
I got at first this error run time message: Failed to find or load the registered .Net Framework Data Provider.I added a reference to "Microsoft.SqlServerCe.Client" at C:ProgrammeMicrosoft Visual Studio 8Common7IDEMicrosoft.SqlServerCe.Client.dll and the program runs.Of course, it uses "Microsoft.SqlServerCe.Client" instead of "System.Data.SqlServerCe". Laxmi Narsimha Rao ORUGANTI from Microsoft writes in the post "SSev and Enterprise Library" that "Microsoft.SqlServerCe.Client" is not meant to be used and that we should add the following entry to the machine.config file:
Code Snippet<add name="SQL Server Everywhere Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Everywhere Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=126.96.36.199, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
I get the same error message as before, even after adding a reference to "System.Data.SqlServerCe" at C:ProgrammeMicrosoft Visual Studio 8Common7IDESystem.Data.SqlServerCe.dll.Any suggestion what I should do ? Just use "Microsoft.SqlServerCe.Client" ? Anyway, I don€™t like the idea that I have to change the machine.config file, since I want to use click once deployment.
We are facing a problem with compact framework 1.0 and SQL CE on windows mobile 5.0 smart phone (Motorola Q).
The application was build for Windows Mobile 5.0. When we use €œSystem.Data.SQLServerCE.dll€? from €œC:Program FilesMicrosoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev3.0€? in compact framework 2.0 it works fine.
Since Motorola Q has .Net Compact Framework 1.0 we need to port same application to compact framework 1.0. There is similar DLL in "C:Program FilesMicrosoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev2.0" but it is not working, it gives runtime error missing method at very first line of code SqlCeEngine _eng = new SqlCeEngine().
Why System.Data.SqlserverCe.Dll doesn't appear in VS2005. In VS2003 System.Data.SqlserverCe.Dll appear to write winCE application. But it won't appear in VS2005 while am selecting PocketPc application. any body gimme the solution.
I'm in the process of migrating several SQL Server 2000 DTS packages to Integration Services packages. One of the old 2000 DTS packages used the SQLXML Bulk Loader component. In order to use the new SQLXML 4 COM object in my Script Task (to initiate the Bulk Loader using .NET code) I've used the tlbimp.exe tool to create a .NET wrapper DLL. I've placed the DLL in the appropriate directory (C:Program FilesMicrosoft SQL Server90SDKAssemblies), successfully added it to my project (with Intellisense working), but when I run the package it fails with the following error:
Could not load file or assembly 'SQLXMLBULKLOADLib, Version=188.8.131.52, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Note: I also tried placing the DLL in C:WINDOWSMicrosoft.NETFrameworkv2.0.50727 with no prevail.
I've confirm the file exists (and any dependencies) in their appropriate locations. Has anyone else run into this? Any help is much appreciated.
Hi, I have a custom library (ReportLibary.dll) and Ä± added it as a reference to the report (Report.rdl). I also copied the dll file to ..IDEPrivateAssemblies. The report uses a methot from the dll to get some data. When Ä± run the report from my local computer there is no problem, the data is generated from the dll. But when I depoy it to the sever an exception occurs.
"Error while loading code module: €˜ReportLibary, Version=184.108.40.206, Culture=neutral, PublicKeyToken=null€™. Details: Could not load file or assembly 'ReportLibary, Version=220.127.116.11, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Can not find the file. d:...Report.rdl"
I hope Ä± can find a solution to my problem. Thanks in advance.
Hello All ...I am attempting to create a program that will run on the PocketPC 2003 environment. I have upgraded Visual Studio to SP1, I have installed SQL Server Compact Edition on my development machine and I have installed SQL Server Compact Edition Tools For Visual Studio on the development machine.I have created a new project Visual Basic - Smart Device - Pocket PC 2003. I have created a form for user input. I build and deploy the form to the Symbol Pocket PC to test - no connection to data and it works.I then add a reference to System.Data.SqlServerCE.dll and rebuild and redeploy the application to the handheld. When I attempt to open the form I receive the following error:psmPocket.exeNotSupportedExceptionSystem.Drawing.Bitmapat System.Resources.ResourceReader.LoadObjectV2() at System.Resources.ResourceReader.LoadObject() at System.Resources.RuntimeResourceSet.GetObject() at System.Resources.ResourceManager.GetObject() at System.Resources.ResourceManager.GetObject() at pmsPocket.frmSetSOPType.InitializeComponent() at psmPocket.frmSetSOPType..ctor() at System.Reflection.RuntimeContructorInfo.InternalInvoke() at System.Reflection.RuntimeContructorInfo.InternalInvoke() at System.Reflection.ContrcutorInfo.Invoke() at System.Activator.CreateInstance() at MyForms.Create__Instance__() at MyForms.get_frmSetSOPType() at psmPocket.SetSOPType.Main()Now the confusing part is that I haven't changed any of the forms or the code behind the forms, I have simply added the reference to the project.Any idea why adding the reference to System.Data.SqlServerCE.dll would cause the system to start generating these errors?I've checked, the install process has loaded the .NET 2 framework to the handheld. And as indicated at the beginning of this message, the application showed the form prior to my adding the reference.Thoughts?Thanks ...
How can I tell if the System.Data.SqlServerCe assembly I am referencing is meant for Desktop use as opposed to Compact development? We are using NUnit as our testing framework and I get the following error when I attempt to execute nunit-console on my test fixture referencing SqlServerCe:
System.IO.FileLoadException : Could not load file or assembly 'System.Data.SqlServerCe, Version=18.104.22.168, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---->
System.IO.FileLoadException : Could not load file or assembly 'System.Data.SqlServerCe, Version=3.0.3600.0, Culture=neutral, PublicKeyToken=3be235df1c8d2ad3, Retargetable=Yes' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
The unit tests run fine from inside of Visual Studio using the Resharper Unit Test Runner...
I have a report that uses some embedded custom code. The embedded custom code is a function that execute some sql query on a sql server database.Everything works fine in Visual studio. The report gets deployed on the server successfully, however when running the report from report manager i get the following error message :
The Hidden expression for the table €˜table1€™ contains an error: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Public function get_field() as string Dim myConnection As System.Data.SqlClient.SqlConnection Dim myCommand As System.Data.SqlClient.SqlCommand Dim data_reader As System.Data.SqlClient.SqlDataReader Dim field(100) as string Dim i as integer Dim j as integer Dim sql_field as string Dim nbr_field as integer Dim rtn_string as string
i = 0 sql_field ="Select field from mytable" myConnection = New System.Data.SqlClient.SqlConnection("Datasource=xxx.xxx.xxx.xxmydatabase;Initial Catalog=mydatabase;User Id=user1;Password=password1;") myConnection.Open() myCommand = New System.Data.SqlClient.SqlCommand(sql_field, myConnection) data_reader = myCommand.ExecuteReader() While data_reader.Read() if data_reader.HasRows then field(i)= data_reader(0).ToString() end if nbr_field = nbr_field + 1 i= i+1 End While data_reader.Close() myConnection.Close()
for j = 0 to nbr_field -1 rtn_string = rtn_string + field(j) + "," Next j
rtn_string = left(rtn_string,rtn_string.length-1) return rtn_string 'return sql_cmd 'return yes_no 'return lkupfield end function
Hi, I am working on a .dll which need to access .sdf ( sql server mobile db). In my project, I added a reference "System.Data.SqlServerCe.dll". The dll is located in C:Program FilesMicrosoft Visual Studio 8Common7IDE. I am able to compile the project. Then I created a Unit project for this dll file. In Unit project, I added the same reference. Now the magic things happen. The compiling was failed. I got "Error 1 The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089'. C:VS2005MobileDBUnitMobileDBProjectUnitMobileDB.cs 50 13 UnitMobileDBProject".
I don't understand how come the same .dll could pass in a dll project but failed in unit test project. And I never saw the System.Data.SqlServerCe display in ".Net" Section of Add reference. But in my office, I installed same version of VS2005 for software tester. I could see the System.Data.SqlServerCe display in the ".Net" section of Add Reference.
We have a Compact Framework 1.1 application that uses Sql Server CE 2.0. In VS2003, a reference to System.Data.SqlServerCe causes the Sql Server CE dlls and Query Analyzer to install to the Emulator or PDA.
I am currently converting the application to Compact Framework 2.0, but we are not upgrading to Sql Server Mobile (yet). However, the reference to System.Data.SqlServerCe, in VS 2005, no longer causes Sql Server CE to install to the PDA/Emulator.
There is a difference in the build outputs between VS2003 & VS2005. In 2003, System_SR_enu.cab, sqlce.wce4.x86.cab & sqlce.dev.wce4.x86.cab are copied & lanuched. In 2005, only System_SR_enu.cab is copied... no launch.
I came across a frustrating bug last week. Basically, whenever I tried to execute almost any sql query with unnamed parameters (i.e. using "?" instead of "@param_name" in the SQL text), an exception would be thrown.
After trying lots and lots of things and navigating my way through the internals of System.Data.SqlServerCe.dll, I discovered that the method System.Data.SqlServerCe.SqlCeCommand.CreateParameterAccessor(...) has a bug.
The bug is that the private arrays "parameters" and "metadata" are ordered differently, yet at one point in CreateParameterAccessor(...) they are compared using the same index. Here are the two lines: p = this.parameters[ i ]; and MetaData info = metadata[ i ] and then the column data types of "info" & "p" are incorrectly compared in a later method, ValidateDataConversion(...).
So take a step back... how are they ordered differently? From observation, I concluded the following: The "parameters" array is ordered exactly in the order that the DbParameter's were added to the DbCommand object. The "metadata" array is ordered according to the column order of the table in the database.
So what causes the exception? Well, CreateParameterAccessor(...) passes data types from two different columns (one type taken from parameters[ i ] and the other from metadata[ i ]) on to SqlCeType.ValidateDataConversion(...). And, of course, if they differ (e.g. one column is of type DateTime and the other is a SmallInt), an exception is thrown. I've found two workarounds, and both seem to work well. The first is to name the SqlCeParameters (e.g. "SELECT ... WHERE id=@id"). This causes the buggy branch of code to be completely bypassed.
The second is to add the SqlCeParameters in the exact same order as the columns exist in the table you are accessing. Note, I do *not* mean the order that you select the columns (e.g. "SELECT column1, column2, ..."). I mean the actual order of the columns in the database.
I've included my setup and a stack trace below to help if it can.
My setup is: .Net CF 3.5 SqlServer CE 3.5 Visual Studio 2008 Deployed to Pocket PC 2003
Here is the stack trace (note the variables passed to ValidateDataConversion):