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:
- Created a simple app with just EF and SQL CE
- Tried the solution in: How to deploy SQL Server Compact Edition 4.0?
- Private install: http://msdn.microsoft.com/en-us/library/aa983326%28VS.80%29.aspx
- Was getting "SideBySide" error in the Event Viewer, tried installing the "Microsoft Visual C++ 2008 Redistributable Package (x86)" in http://www.microsoft.com/en-ca/download/details.aspx?id=29, didn't help either
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