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 Posted by friism Support staff on 16 May, 2011 11:36 PM
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
binfolder. You should place them in alibfolder and not push thebinfolder at all (AppHarbor will populate thebinfolder when building you code). We recommend addingbinanddebugfolders to your .gitignore.If that doesn't resolve the issue, there are some suggestions here
friism closed this discussion on 16 May, 2011 11:36 PM.
Timothy Burch re-opened this discussion on 20 May, 2011 12:54 AM
#2 Posted by Timothy Burch on 20 May, 2011 12:54 AM
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.
#3 Posted by friism Support staff on 20 May, 2011 05:08 PM
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.
friism closed this discussion on 20 May, 2011 05:08 PM.