Deploying SQL CE 4 to IIS 7 – Special Permissions Needed?

I have an ASP.NET 4 site that uses the new SQL CE 4 CTP. The site works fine locally (IIS 7.5 on Win7) and fine in Server 2003/IIS 6. It fails when deploying to IIS 7 on Server 2008. The error I get is:

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

The interesting thing is if I switch the app pool user from its default user to LocalSystem, everything works great. So clearly there is a permissions problem somewhere.

Long story short, does anyone know what special permissions need to be set when deploying a SQL CE 4 database? (BTW, we have already set r/w access on the db itself and on c:windowstemp)

Thanks!

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

The actual solution was to add IUSR permissions to the bin directory (that were somehow missing). Hope this helps someone else in the future!

Method 2

Write access to the folder where the database files resides. You can use Process Explorer to determine what permissions are missing.

Method 3

I’m currently running a web server with a fresh copy of Windows Server 2008 R2 with SQL CE 4.0 installed into GAC.

I had a similar problem but it was more along the lines of:

“The underlying provider failed on Open” in the event logs. I’d try everything as well as looked up everything on SO and google. Tried both suggestions here and finally started making some headway.

In addition to adding read/write permissions (Thanks ErikEJ) was a step in the right direction, but which user exactly to grant those permissions to was the hard task (Thanks Robbo). Unfortunately, this didn’t help me completely and after labouring
back and forth with user and permissions the the end result was that I needed the following two permissions before it worked:

IUSR
IIS_IUSRS

Both required read/write permissions to the application folder.

Hope this helps out along with the provided answer above – Sure helped me out.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x