title: SQL Server CE - Internal error: Cannot open the shared memory region
body: <p>I have a SQL Server CE database that works fine in dev, but when installed on the client has an issue.  </p>
  
  <ul>
  <li>The SQL Server CE 3.5 dependencies are copied as part of the deployment.</li>
  <li>The target machine is a clean Windows 7 32-bit Ultimate image.</li>
  </ul>
  
  <p>The message for the exception in the event log is:</p>
  
  <pre><code>Message: Internal error: Cannot open the shared memory region. 
  Stack Trace: at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr) at
  System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent) at
  System.Data.SqlServerCe.SqlCeConnection.Open() at
  System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user) at
  System.Data.Linq.SqlClient.SqlProvider.Execute(
      Expression query, 
      QueryInfo queryInfo,
      IObjectReaderFactory factory, 
      Object[] parentArgs, 
      Object[] userArgs,
      ICompiledSubQuery[] subQueries, 
      Object lastResult) at
  System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(
      Expression query, 
      QueryInfo[] queryInfos,
      IObjectReaderFactory factory, 
      Object[] userArguments, 
      ICompiledSubQuery[]
      subQueries) at
  System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(
      Expression query) at
  System.Data.Linq.DataQuery`1.System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator() at 
  System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at
  System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at
  Application specific stuff here
  </code></pre>
  
  <p>It looks like this is <a href="http://msdn.microsoft.com/en-us/library/ms171879.aspx" rel="noreferrer">SSCE_M_CANTOPENSHAREDMEMORY</a> and the site says there isn't a connection string value to change this and that these issues are typically not resolvable by the end developers.</p>
  
  <p>Has anyone run into this, and if so were you able to resolve this issue?</p>