The Problem Solver

Tell me and I will forget
Show me and I will remember
Involve me and I will understand
- Confucius -

Google Ads

This Blog

Syndication

Search

Tags

News





  • View Maurice De Beijer's profile on LinkedIn

Community

Email Notifications

Explore

Archives

Deploying SqlServerCe with an ASP.NET MVC application

Using Entity Framework Code First together with SqlServerCe is a great way to work with small databases in ASP.NET MVC applications. I have several web applications running on shared hosting sites where SqlServerCe is the database engine under the hood. Deploying is also quite easy. I typically use the build in Publish Web option which works great over FTP.

image

 

When using SqlServerCe you have to make sure you add the deployable dependencies. Forgetting those results in pretty clear error messages.

image

 

However once that is done I always run into another issue. When a page actually tries to use SqlServerCe I will see a security exception:

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

The solution is simple enough. Go to whatever security portal your provider is using, mine is using Plesk, and make sure the user that is actually running the web site has the required read/write privileges to work with the Bin folder.

 

image

 

 

Enjoy!

 

TheProblemSolver
DotNetEvents

Published Tue, Jan 24 2012 11:50 by Maurice
Filed under: , , ,