0

I have my app that needs SQL Server CE 4.0 (using Entity Framework) and net framework 4. I put into requirements net framework 4 and SQL Server CE 4.0 (for this last one I have to make a special requirement because it is not in the default list).

The problem is when I have a Windows XP clean, and I run my app setup. First It detects that I don't have installed SQL Server CE 4.0, I agreed and my app install SQL Server CE. After this installation, the setup detect that I don't have .NET Framework 4 and the same again. It also install .NET Framework 4. Both of binaries are from my setup (no internet connection).

So, the setup then install the app. When I try to use the app, an error occurs:

Type : System.ArgumentException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The specified store provider cannot be found in the configuration, or is not valid.
Source : System.Data.Entity
Data : System.Collections.ListDictionaryInternal
TargetSite : System.Data.Common.DbProviderFactory GetFactory(System.String)
Stack Trace :
at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
at System.Data.EntityClient.EntityConnection..ctor(String connectionString)
at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName)
at DAL.DataModel.SpecaModelContainer..ctor() in D:\Desarrollos\CNE\SPECA\DAL\DataModel\Model.Context.cs:line 24
at DAL.Repository.SpecaContext.getContext() in D:\Desarrollos\CNE\SPECA\DAL\Repository\SpecaContext.cs:line 17
at DAL.Repository.BaseRepository`1.get_contexto() in D:\Desarrollos\CNE\SPECA\DAL\Repository\BaseRepository.cs:line 18
at DAL.Services.DistritoRepository.obtenerUniverso() in D:\Desarrollos\CNE\SPECA\DAL\Repository\DistritoRepository.cs:line 18

Ok. Then I install again the Win XP and I install my app with out requirements. Then I install .NET Framework 4 and then SQL Server CE 4.0. And when I run the app, NO ERROR appears. It works fine.

So, if I install SQL Server CE 4.0 before .NET Framework 4 I have the problem, but not the other way.

Anyone knows why? Where can I tell my app install project to change the order of requirements?

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
emmanuel sio
  • 1,935
  • 3
  • 24
  • 26
  • Why not simply include SQL CE 4.0 directly with your app ("Private deployment") ? – ErikEJ Apr 17 '13 at 05:20
  • I see this http://stackoverflow.com/questions/3223359/cant-get-sql-server-compact-3-5-4-to-work-with-asp-net-mvc-2/3223450#3223450 where you also comment. It helps but in some machine with Windows XP doesnt work so I have to install sql ce – emmanuel sio Apr 18 '13 at 03:26
  • XP must be SP3, and add DbProvider settings to your config file, and include the correct version of System.data.SqlServerCe.dll - see my blog – ErikEJ Apr 18 '13 at 13:14
  • Ok. Thanks!. Another question is if we can trust in sqlce 4.0.0.1 or have some problems? I see same post talking not to use System.Data.SqlServerCe.dll from private. the recommend use from desktop. – emmanuel sio Apr 24 '13 at 16:09
  • On web use 4,0,0,0 - on desktop use 4,0,0,1 for private deployment – ErikEJ Apr 24 '13 at 16:17

0 Answers0