Trouble Deploying Sql Server CE 4.0 to IIS 7
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 co开发者_如何学JAVAnnection 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,
IIS APPPOOL\DefaultAppPool
Note that the user group must be specified as shown.
Not 100% sure but it think it may be the Network Service account that needs permissions.
精彩评论