尝试删除临时 ASP.NET 文件夹中的文件时访问被拒绝

Access denied when trying to delete a file in Temporary ASP.NET Files folder

在 VS 2013 中构建后,我无法 运行 Web 应用程序。我收到以下错误:

Access to the path 'C:\Users\Thelonius\AppData\Local\Temp\Temporary ASP.NET Files\vs74c594dbfd8b\DotNetOpenAuth.OpenId.dll' is denied.

我尝试直接使用 Windows Explorer 删除 DLL,但遇到了以下对话框:

You require permission from the computer's administrator to make changes to this file DotNetOpenAuth.OpenId.dll

我觉得这很奇怪,因为我 运行ning 作为管理员。当我尝试从资源管理器中的“安全”选项卡更改权限时,我收到以下消息:

You must have Read permissions to view the properties of this object.

我无法更改项目的所有权。这个问题有解决办法还是我应该再创建一个 ASP.NET 临时文件夹?这很奇怪。如果有帮助,我是 运行宁 Windows 10.

值得一提的是,Windows Handle 实用程序声称 VS 2013 已打开文件,但为什么不能删除它?另外,如果文件在 2012 年 Visual Studio 之前打开,错误消息不应该说文件已打开吗?

要清除临时 asp.net 目录,您需要:

  1. 停止 IIS 服务(或只是停止您要清除的网站)
  2. 关闭所有 visual studio 程序(或仅关闭您使用的网站)