拒绝访问该路径

时间:2013-06-13 16:03:07

标签: asp.net-mvc asp.net-mvc-3 asp.net-mvc-4

我将简单的应用程序发送到我的localhost。 在Windows 7中,我的应用程序可以正常运行,但是当我尝试在Windows 8中调试和运行时,我的应用程序给了我一些这样的错误

Access to the path 'C:\604ea33a-0b6c-4b47-8e4e-5ff9ff3c35a8.eml' is denied.

 An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

有人可以告诉我,我的代码有什么问题吗?

感谢

2 个答案:

答案 0 :(得分:0)

我将路径目录更改为C:/ Windows / Temp 并在Windows 8中正确运行

答案 1 :(得分:0)

您必须获得UnauthorizedAccessException。操作系统因I / O错误或特定类型的安全错误而拒绝访问时引发的异常。

这显然是权限问题

如果Vista/Windows 7/8C:\驱动器被视为系统驱动器,并且需要您的进程的管理员权限才能直接在其下创建文件。

尝试使用管理员或Run Visual Studio as Administrator运行您的流程,它应该可以正常运行。

相关问题