When trying connecting to SQL Server CE 4.0 (SqlServerCe.dll, v2.0.50727
), I get an exception (System.Data.Common.DbException
) saying:
The CRT binary present in application/bin folder is not signed and can be a potential security risk. Please place the original Microsoft CRT binary in application/bin folder.
All files are downloaded from microsoft.com
string localDataFile = Path.Combine(dataPath, "StorageData.sdf");
var connectionString = String.Format("Data Source={0}", localDataFile);
if (!File.Exists(localDataFile))
{
SqlCeEngine engine = new SqlCeEngine(connectionString);
engine.CreateDatabase();
engine.Dispose();
}
var connection = new SqlCeConnection(connectionString); <----Here the exception occures
StorageContext context = new StorageContext(connection);
return context;
System:
- Windows 7
- Visual Studio 2010
- .NET 4.0
Any ideas?
UPDATE: Reinstalling the following files has fixed the problem:
Thanks for trying to help!