vb.net 无法创建 PDB 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/627523/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unable to create PDB file
提问by Ryan Smith
For some reason this error started popping up today on one of my projects.
出于某种原因,这个错误今天开始出现在我的一个项目中。
Error 1 Unable to write to output file 'C:\MyProject\Release\MyProject.pdb': Unspecified error
错误 1 无法写入输出文件“C:\MyProject\Release\MyProject.pdb”:未指定的错误
If I go into advanced compile options and change it to not generate and debug info, my project compiles fine.
如果我进入高级编译选项并将其更改为不生成和调试信息,我的项目编译正常。
I have tried setting the permissions on the Release folder to full for everyone, so I would assume it's not a permissions issue. Also, I don't see anything in my log files that would provide me with more information about the issue.
我已经尝试将 Release 文件夹的权限设置为每个人都已满,所以我认为这不是权限问题。此外,我在日志文件中没有看到任何内容可以为我提供有关该问题的更多信息。
Does anyone know why this error would just start showing up or a way to fix it?
有谁知道为什么这个错误会开始出现或解决它的方法?
Thanks.
谢谢。
Update: I have rebooted my machine, restarted VS several times and have even completely deleted the existing OBJ file where the issue is happening. It's still giving me the same error.
更新:我重新启动了我的机器,重新启动了 VS 几次,甚至完全删除了发生问题的现有 OBJ 文件。它仍然给我同样的错误。
This is a simple one project solution that was working fine just last week. It appears to be an issue with VS trying to build the PDB file because I can delete them out of the Release and Debug folders without issue. When I try rebuilding them VS will start creating the file (about 1.4MB is size) but I still get the error.
这是一个简单的项目解决方案,上周运行良好。VS 尝试构建 PDB 文件似乎是一个问题,因为我可以毫无问题地将它们从 Release 和 Debug 文件夹中删除。当我尝试重建它们时,VS 将开始创建文件(大小约为 1.4MB),但我仍然收到错误消息。
回答by Ryan Smith
After banging my head on the wall for a while on this one and digging through source control to try to get back to a working copy, it turned out that the PDB file wasn't the issue at all. Someone had deleted a source file which was causing VS to choke when I tried to find that file to create the debug information.
在我的头撞在墙上一段时间并通过源代码控制挖掘以尝试返回工作副本后,结果证明 PDB 文件根本不是问题。有人删除了一个源文件,当我试图找到该文件以创建调试信息时,该文件导致 VS 阻塞。
So if anyone comes across this error and can't figure it out, make sure that you aren't missing a source file somewhere.
因此,如果有人遇到此错误并且无法弄清楚,请确保您没有在某处丢失源文件。
It would have been very helpful if VS would have told me that file is missing rather than just telling me it had an unspecified error creating the PDB file.
如果 VS 告诉我文件丢失而不是仅仅告诉我它在创建 PDB 文件时出现未指定的错误,那将会非常有帮助。
Thanks.
谢谢。
回答by Colin Pear
Here is a MUCH better way to fix this issue.
这是解决此问题的更好方法。
Basically close your solution and re-open it without compiling. Check the Error List and it will show you which files are missing.
基本上关闭您的解决方案并重新打开它而不编译。检查错误列表,它会显示丢失了哪些文件。
回答by Markive
This worked for me where the other answer's here failed:
这对我有用,其他答案在这里失败了:
Unable to write to output file [FileName] .pdb: Unspecified error Visual Studio
回答by Avram
If you work on solution with more than one projectsinside, there is possibility of wrong compile order.
如果您在解决方案中包含多个项目,则可能会出现错误的编译顺序。
回答by KyleMit
I wanted to add on top of the typical Turn it off and on again
with the reason why that's helpful.
我想在典型的基础上Turn it off and on again
加上这有帮助的原因。
Visual studio can get wrapped around the axle when building a project so that it can't figure out why it's missing a particular dependency, it just knows that it can't build the project.
Visual Studio 在构建项目时可能会被轴缠住,因此它无法弄清楚为什么缺少特定的依赖项,它只知道它无法构建项目。
Here's an undescriptive error message after a failed rebuild:
这是重建失败后的非描述性错误消息:
The solution is to:
解决办法是:
- Close Visual Studio
- Open Visual Studio
- Do NotCompile- Look at the error list for a new descriptive error:
- 关闭 Visual Studio
- 打开 Visual Studio
- 做不编译-看看在新的描述错误的错误列表:
A lot of the existing instructions are missing the third step, so I thought this might be helpful.
许多现有的说明都缺少第三步,所以我认为这可能会有所帮助。
回答by Tim Sullivan
Perhaps something else has the file open, like an editor or another copy of Visual Studio?
也许其他东西打开了文件,比如编辑器或 Visual Studio 的另一个副本?
Try shutting down and restarting VS, or even rebooting your machine to see if that resolves the problem.
尝试关闭并重新启动 VS,甚至重新启动您的机器,看看是否能解决问题。
回答by David Pokluda
In the worst case try to restart Visual Studio. Another good tool for you to try is Process Explorerfrom SysInternals that allows you to see who is keeping handle on your PDB file. This way you know exactly what to kill/restart to get access to the file.
在最坏的情况下尝试重新启动 Visual Studio。您可以尝试的另一个好工具是SysInternals 的Process Explorer,它允许您查看谁在处理您的 PDB 文件。这样您就确切地知道要杀死/重新启动什么才能访问文件。
回答by ramp
Check for missing files which will be shown in visual studio with exclamatory icon and those files may not exist in project source folder. if you don't want those files delete them in visual studio else add those files in source folder. clean or refresh..
检查将在 Visual Studio 中显示为带有感叹号图标的丢失文件,并且这些文件可能不存在于项目源文件夹中。如果您不希望这些文件在 Visual Studio 中删除它们,请在源文件夹中添加这些文件。清洁或刷新..
回答by AACinc
I was receiving the same error and it ended up being a web reference that needed to be updated. After updating all the web references the issue persisted. Finally I added the same web reference as the same url and name and the add web reference told me that there was a reference by the same name and provided an option to update it with the latest information. This finally worked and the project is running again.
我收到了同样的错误,它最终成为需要更新的网络参考。更新所有网络引用后,问题仍然存在。最后,我添加了相同的 web 引用作为相同的 url 和名称,并且添加 web 引用告诉我有一个同名的引用,并提供了一个使用最新信息更新它的选项。这终于奏效了,项目再次运行。
回答by Rohan Sapkal
I was getting same error. Turned out that the 'Service Reference' folder was out of date. I deleted and added service reference again and it started working.
我遇到了同样的错误。结果发现“服务参考”文件夹已过时。我再次删除并添加了服务引用,它开始工作。