|
Saturday, August 02, 2008 |
| Unable to open the physical file \App_Data\DevResource.mdf. Operating system error 5: 5(Access is denied.). |
|
Here is the exact error I received.
Unable to open the physical file "C:\Develop\WebSites\Developer Resource\App_Data\DevResource.mdf". Operating system error 5: "5(Access is denied.)". An attempt to attach an auto-named database for file C:\Develop\WebSites\Developer Resource\App_Data\DevResource.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
After a little Googling something I read pointed me in the right direction. I imagine there are many scenarios that could trigger this error. In my case, I had restored a backup file into the App_Data folder of my website, setup the web.config, and tried to run. The issue was that when I restored the database backup file, the MDF file created in my App_Data folder, didn't have any file permissions on it. So I gave asp.net account rights and everything worked fine. |
jeremy at 9:35 PM |
(10) Comments |
Add a comment |
Permalink
|
|
|
|