SQL Compact Framework Error(4.0) with VS 2008 SP1 Web(C#)

790 views Asked by At

I have tried several of your suggestions. I assume that SQL Compact Framework 4 will work with VS 2008 Version 3.5 SP1. Thank you for your help.

Felice

Server Error in '/' Application.

Could not load file or assembly 'System.Data.SqlServerCe.Entity' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.BadImageFormatException: Could not load file or assembly 'System.Data.SqlServerCe.Entity' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data.SqlServerCe.Entity' could not be loaded.

=== Pre-bind state information === LOG: User = MONTOYA\Felice LOG: DisplayName = System.Data.SqlServerCe.Entity (Partial) LOG: Appbase = file:///C:/Documents and Settings/Felice/My Documents/Visual Studio 2008/Projects/WEBTEST/WEBTEST/ LOG: Initial PrivatePath = C:\Documents and Settings\Felice\My Documents\Visual Studio 2008\Projects\WEBTEST\WEBTEST\bin

Calling assembly : (Unknown).

LOG: This bind starts in default load context. LOG: Using application configuration file: C:\Documents and Settings\Felice\My Documents\Visual Studio 2008\Projects\WEBTEST\WEBTEST\web.config LOG: Using machine configuration file from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/22f9383d/8a864690/System.Data.SqlServerCe.Entity.DLL. LOG: Attempting download of new URL file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/Temporary ASP.NET Files/root/22f9383d/8a864690/System.Data.SqlServerCe.Entity/System.Data.SqlServerCe.Entity.DLL. LOG: Attempting download of new URL file:///C:/Documents and Settings/Felice/My Documents/Visual Studio 2008/Projects/WEBTEST/WEBTEST/bin/System.Data.SqlServerCe.Entity.DLL. ERR: Failed to complete setup of assembly (hr = 0x8013101b). Probing terminated.

1

There are 1 answers

4
ErikEJ On

See the reply here (including additions to web.config) (the runtime section is not required) Can't get sql server compact 3.5 / 4 to work with ASP .NET MVC 2