Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

error with reference to System.Data.SqlServerCe.Entity dll

I just pushed my first app to AppHarbor. The app builds and I can get to the home page, but on any other page I get a 'Sorry, an error occurred while processing your request' message. This is an ASP.NET MVC 3 app using EF Code First over Sql Server CE.

When I checked the build log, I see the following warning:
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

I have checked the reference locally and it is set to 'Copy Local = True'. All versions match and I have verified that the dll is in my project bin folder and is included in my local git repo.

I cannot think of any other reason why I would receive this error?

  1. You may be missing some extra dll's. The error I see when looking at your app without remote errors is:
    "Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8482. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details. "

    It's generally a really bad idea to include referenced dll's in your bin folder. You should place them in a lib folder and not push the bin folder at all (AppHarbor will populate the bin folder when building you code). We recommend adding bin and debug folders to your .gitignore.

    If that doesn't resolve the issue, there are some suggestions here

  2. friism closed this discussion on 16 May, 2011 11:36 PM.

  3. Timothy Burch re-opened this discussion on 20 May, 2011 12:54 AM

  4. I moved the dll out of the bin folder and into the lib folder and I upgraded to SQL Server CE 4. Everywhere I see the dll, it is the same version, but I am still getting the same error.

    The one difference is that the project now builds without any warnings, but still throws an error at runtime.

  5. Getting SQL Server CE to work is notoriously finicky. Please refer to this sample project that uses CE for unit testing.

    Also, note that using SQL Server CE is generally a bad idea because the app filesystem is not synced betweeen instances and because the the files are overwritten on each deploy.

  6. friism closed this discussion on 20 May, 2011 05:08 PM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac