您的位置:首页 > 大数据 > 人工智能

VS 2010: An error occurred loading a configuration file: Failed to map the path ‘/’.

2011-02-20 21:41 991 查看
I was using the System.Web.Configuration.WebConfiguration class to open the configuration for the site from one of my logic dll’s and I got the wonderful error An error occurred loading a configuration file: Failed to map the path ‘/’.

I freaked out for a second, until I put more thought into it. This is running fine in production! What is the difference with my machine and the server?

Oh! My Visual Studio is running under UAC with limited privileges since I am in Windows 7. DUH!

So, I restarted Visual Studio 2010 under “Run as Administrator” and problem solved. So if you are on Vista or Windows 7, that’s the issue.

NOTE: If you develop with administrative rights, be careful you don’t make development mistakes that assume everyone will run your program as an admin. i.e. writing to program files directory, root directory, etc.

Happy Coding!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐