4
votes

I have an ASP.NET MVC 3 application which I want to deploy to Azure. The application uses EF against a SQL Server CE 4.0 database in the App_Data directory.

The site runs fine locally but when I reference it from an ASP.NET MVC 3 web role and publish it to Azure I get this error:

"Unable to find the requested .Net Framework Data Provider. It may not be installed." The full exception can be viewed here: http://52df5a4a5c1b4d10a927078bb8a06d15.cloudapp.net/drug

Here is connection string from the web.config file:

<add name="DbEntities" connectionString="metadata=res://*/AMDBModeledmx.csdl|res://*/AMDBModeledmx.ssdl|res://*/AMDBModeledmx.msl;provider=System.Data.SqlServerCe.4.0;provider connection string=&quot;Data Source=|DataDirectory|\AMDB.sdf&quot;" providerName="System.Data.EntityClient" />

I have tried compiling my project to target x86 and setting the "Copy Local" property of the System.Data.Entity reference to true. Nothing helps.

Is it possible to run a web app in Azure and use a file-based database? I understand this can be a problem with multiple instances, but I'm only using a single VM.

1
Azure does not work with SQL Server Compact, use SQL AzureErikEJ

1 Answers

3
votes

I can't see your error page, but it looks like the SQL CE Data Provider DLL is missing. Have you tried following these instructions?

http://blogs.msdn.com/b/webdevtools/archive/2011/01/06/how-to-bin-deploy-sql-compact-edition-4-0-and-razor-web-projects.aspx