I’m having trouble deploying an ASP.Net application using Sql Server CE 4.0. I get the following error:
Access to the database file is not allowed.
I’ve verified that I’m using the local “add_data” folder in my connection string:
<add name="DemoStudy" connectionString="metadata=res://*/Data.StudyContext.csdl|res://*/Data.StudyContext.ssdl|res://*/Data.StudyContext.msl;provider=System.Data.SqlServerCe.4.0;provider connection string="Data Source=|DataDirectory|\CRS20SandboxCE.sdf"" providerName="System.Data.EntityClient"/>
I’ve also tried granting IUSR account full access to the app_data directory, but that didn’t seem to help. Another SO thread suggests granting IUSR access to the bin directory, but that didn’t help either.
UPDATE:
Well, it’s definitely a permissions issue. If I give the “Everyone” user group access to the app_data folder, everything works fine.
QUESTION:
What is the correct user to give full access to in IIS 7? It’s obviously not IUSR…
One must grant read/write access to the appropriate app_pool user. In this case,
Note that the user group must be specified as shown.