I have an application with EF 4.3.0 and Microsoft SQL Server CE 4.0.
Whenever I try to load the application, I get the following in error:
This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
at System.Data.SqlServerCe.SqlCeConnection..ctor()
at System.Data.SqlServerCe.SqlCeProviderFactory.CreateConnection()
at System.Data.Entity.Infrastructure.SqlCeConnectionFactory.CreateConnection(String nameOrConnectionString)
at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()
at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.IEnumerable.GetEnumerator()
at System.Data.Entity.DbExtensions.Load(IQueryable source)
at TestEfSqlCeOnXp.MainWindow.Window_Loaded(Object sender, RoutedEventArgs e)
I have tried the following approaches (with no luck) to solve the problem:
Just more info on the WPF app, it works on Windows 7/8 but we're trying to retrofit it unto XP as this is a requirement for the project.
Thanks in advance StackOverflow community.
'Akapet
Problem solved:
ErickEJ made a good point of referencing 4.0.0.0 or 4.0.0.1 but I was already doing this. This made me to check the version of SQL Server CE I have installed on the XP machine, which was SQL CE 4.0.8876.1, and happened to be 4.0 SP1.
So the solution is uninstalling 4.0 SP1 and installing just 4.0 (no SP1) of SQL CE.
Now I don't get the error anymore, database gets created and no "SideBySide" error in the Event Viewer.
Thx all.
User contributions licensed under CC BY-SA 3.0