1

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!

Markus
  • 19
  • 3
  • What does the connection string look like?? Can you inspect that in the debugger on that line, before the exception happens? – marc_s Oct 12 '12 at 13:54
  • 1
    Are you using private deployment? – ErikEJ Oct 13 '12 at 07:18
  • The connection string looks like: Data Source=\\172.32.234.51\Files\Archive_CentralStorage\ARC_Storage01\_Info\StorageData.sdf – Markus Oct 15 '12 at 06:36

1 Answers1

0

I encountered this error today while helping one of our customers with a problem in our software:

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.

Our software was trying to create and initialize a Windows CE database. I bypassed the issue by setting the following registry key described by this Microsoft KB article:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\WinTrust\Trust Providers\Software Publishing

I looked for the value "State". It did not exist, so I created a DWORD value and set it to 23e00. This corresponds to the Internet Options / Advanced setting "Check for publisher’s certificate Revocation" being unchecked (see the linked KB article above).

This may not be the best solution for you or other readers, but I wanted to record it for future reference.

Paul Williams
  • 16,585
  • 5
  • 47
  • 82