简体   繁体   English

“拒绝访问路径'Calculations.pdb'。”但是,对其他所有文件的访问都可以

[英]“Access to the path 'Calculations.pdb' is denied.” But access is fine for all the other files

We have C# code that gets compiled dynamically and saved in a folder, let's say Assembly. 我们拥有可以动态编译并保存在文件夹中的C#代码,例如Assembly。 The program is run as administrator. 该程序以管理员身份运行。

When we rebuild the assembly, we delete all the files in the folder Assembly. 重建程序集时,我们将删除程序集文件夹中的所有文件。 There is no problem when deleting the .cs and .dll files, but the .pdb file (as in the title) doesn't get deleted and the exception is thrown. 删除.cs和.dll文件时没有问题,但是.pdb文件(如标题中所示)不会被删除,并且会引发异常。

Why do I have this problem only with the pdb file? 为什么我只有pdb文件有此问题?

It seems the pdb file's symbols were loaded in Visual Studio, and thus when I was debugging it couldn't be deleted. 似乎pdb文件的符号已在Visual Studio中加载,因此在调试时无法将其删除。 I was debugging to see what the error was. 我正在调试,以查看错误是什么。 So when I didn't load the symbols automatically anymore, it worked. 因此,当我不再自动加载符号时,它就起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM