错误CS2012:无法打开[file.pdb]进行写入 - '访问路径[pdb文件的路径]被拒绝'。 [英] error CS2012: Cannot open [file.pdb] for writing -- 'Access to path [path to pdb file] is denied'.

查看:475
本文介绍了错误CS2012:无法打开[file.pdb]进行写入 - '访问路径[pdb文件的路径]被拒绝'。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

环境:

Microsoft Visual Studio Professional 2017 RC

版本15.0.26206.0 D15REL

Microsoft .NET Framework

版本4.6.01586

错误: 

错误CS2012:无法打开[file.pdb]进行写入 - '访问路径[pdb文件的路径]被拒绝' 。

error CS2012: Cannot open [file.pdb] for writing -- 'Access to path [path to pdb file] is denied'.

说明:

我正在为.net核心1.1构建一个.netcore应用程序,其他库目标是.netstandard1.6。当我构建项目时,我遇到了错误。当它处于这种状态时,我无法清理/构建或运行项目。项目
第一次打开时不会发生,它似乎非常随机,因为它在我收到错误之前可能会工作几次。

I am building a .netcore application for .net core 1.1 with other libraries targeting .netstandard1.6. When I build the project I get above error. I cannot clean/build or run the project when it is in this state. Does not happen the first time the project is open, it seems very random, because it may work a few times before I get the error.

当我通过它导航到它时explorer我也无法删除.pdb文件,也不能删除调制目录中的netcore1.0或netstandard1.6文件夹的父文件夹。我甚至无法更改文件或文件夹的权限。我是个人电脑的
管理员。

When I navigate to it via explorer I also cannot delete the .pdb file nor the parent folder which is  either the netcore1.0 or netstandard1.6 folders in in the Debug directories. I cannot even change the permissions on the files or folders. I am an administrator on the pc.

谢谢

推荐答案

您好jeanproux,

Hi jeanproux,

当Visual Studio执行构建操作时,此问题与Visual Studio无法编写[file.pdb]文件有关。由于此问题,Visual Studio无法完成构建过程,因此它将保持此文件锁定。所以你不能
清理/构建或运行项目,也无法删除.pdb文件,也不能删除处于此状态的父文件夹。

This issue is more relate to the Visual Studio could not write the [file.pdb] files when Visual Studio executed the build operation. Due to this issue, Visual Studio could not complete the build process, then it will keep this file lock. So you could not clean/build or run the project and also could not delete the .pdb file nor the parent folder when it is in this state.

非常很难弄清楚Visual Studio的根目录无法打开[file.pdb]进行编写。因为这个问题是随机发生的,我们无法复制。但您可以尝试
关闭Visual Studio,然后删除[file.pdb]文件并重建项目

It`s very difficult to figure out the root of Visual Studio can not open the [file.pdb] for writing. Because this issue occurs randomly and could not be reproduced by us. But you can try to close Visual Studio, then delete the [file.pdb] file and rebuilding the project.

请注意:感谢Jean Roux的贡献,他使用Process Explorer找出了名为ServiceHub.DataWarehouseHost.exe的进程,该进程具有该文件的句柄。杀死该句柄然后再次构建。

Note that:Thanks for Jean Roux`s contribution, he used Process Explorer to find out the process called ServiceHub.DataWarehouseHost.exe that has a handle on the file. Kill that handle then the build works again.


这篇关于错误CS2012:无法打开[file.pdb]进行写入 - '访问路径[pdb文件的路径]被拒绝'。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆