简体   繁体   English

尝试在调试模式下运行项目时出现“找不到文件...\\bin\\Debug”错误

[英]"Could not find file...\bin\Debug" error when trying to run project at debug mode

I know it's a relatively frequent asked question, but none of the solutions that had been offered works for me, so as a last resort, I am raising it again:我知道这是一个相对常见的问题,但提供的解决方案都不适合我,所以作为最后的手段,我再次提出:

suddenly, when trying to run my project at debug mode, I'm getting errors:突然,当我尝试在调试模式下运行我的项目时,出现错误:

"Can not load NameOfFIleHere.xml file - Could not find file 'c:\\Users\\FullLocationHere\\bin\\Debug\\NameOfFIleHere.xml'" and "Can not load 'c:\\Users\\FullLocationHere\\bin\\Debug\\NameOfFIleHere.xml' - Configuration system failed to initialize" “无法加载 NameOfFIleHere.xml 文件 - 找不到文件 'c:\\Users\\FullLocationHere\\bin\\Debug\\NameOfFIleHere.xml'”和“无法加载 'c:\\Users\\FullLocationHere\\bin\\Debug\\NameOfFIleHere.xml” ' - 配置系统初始化失败”

I'm working on this project for a while now and never had any similar problem.我现在在这个项目上工作了一段时间,从来没有遇到过类似的问题。 in addition, I haven't changed any of my xml files lately nor did I made any major code/settings modification since the last time it run successfully.此外,自从上次成功运行以来,我最近没有更改任何 xml 文件,也没有进行任何主要的代码/设置修改。 I'm working on Visual Studio 2013 with TFS.我正在使用 TFS 处理 Visual Studio 2013。 May anyone please offer me some ideas as to why it keeps happening?任何人都可以请给我一些关于为什么它不断发生的想法吗?

Thanks a lot!非常感谢!

Some of the solutions I've tried:我尝试过的一些解决方案:

Unable to copy file, Access to the path is denied 无法复制文件,拒绝访问路径

Could not find file ..\\bin\\Debug\\content.dat 找不到文件 ..\\bin\\Debug\\content.dat

Unable to copy a file from obj\\Debug to bin\\Debug 无法将文件从 obj\\Debug 复制到 bin\\Debug

When working with content-files (xml, images, etc..) that come from another project than the GUI/Starting-Project it can sometimes happen, that the file cannot be written in the GUI/Starting-Project's bin\\debug even if it's set to "copy always".当使用来自另一个项目而不是 GUI/Starting-Project 的内容文件(xml、图像等)时,有时会发生该文件无法写入 GUI/Starting-Project 的 bin\\debug,即使它设置为“始终复制”。 I observed that it happens during the rebuild process, when Visual Studio cleans up the old compile.我观察到它发生在重建过程中,当 Visual Studio 清理旧编译时。 Fairly randomly, it seems that a file-handle gets stuck and prevents the files to be created.相当随机,似乎文件句柄卡住并阻止创建文件。

Personally I solved the problem by copying needed application files to我个人通过将所需的应用程序文件复制到

Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
"CompanyName", "AppName")

which resolves to:其解析为:

C:\ProgramData\CompanyName\AppName

Just an update as to how it was solved: I've ended up deleting the project from tfs and uploaded an older copy of it from another folder (which is located directly under C:, as was recommended to me above).只是关于它如何解决的更新:我最终从 tfs 中删除了该项目,并从另一个文件夹(直接位于 C: 下,正如上面向我推荐的那样)上传了它的旧副本。 not the most elegant solution, but it worked for me.不是最优雅的解决方案,但它对我有用。

暂无
暂无

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

相关问题 尝试在调试模式下运行项目时出错,但如果我运行EXE文件则有效 - Error while trying to run project in debug mode, but works if I run the EXE file System.IO.FileNotFoundException: 找不到文件 'x\\x\\x\\x\\bin\\debug\\project.dll - System.IO.FileNotFoundException: Could not find file 'x\x\x\x\bin\debug\project.dll 找不到文件 ..\\bin\\Debug\\content.dat - Could not find file ..\bin\Debug\content.dat 神秘异常“找不到文件'D:\\ xxxx \\ bin \\ Debug \\ xxx.vshost.exe.config'。” - mysterious exception “Could not find file 'D:\xxxx\bin\Debug\xxx.vshost.exe.config'.” 为什么我收到错误“找不到文件'C\Users\daylo\Onedrive\Desktop\VisualStudio\Total Sales\Total Sales\bin\Debug\Sales/txt' - Why do I get the error 'could not find file 'C\Users\daylo\Onedrive\Desktop\VisualStudio\Total Sales\Total Sales\bin\Debug\Sales/txt' 项目'Projr'不是最新的。 在VS 2017管理员模式下缺少输出文件'c:\\ .. \\ bin \\ Debug \\ Projr.dll' - Project 'Projr' is not up to date. Missing output file 'c:\..\bin\Debug\Projr.dll' in VS 2017 Administrator mode 无法在Visual Studio 2017社区版本中运行WCF调试模式 - Could not run WCF debug mode in visual studio 2017 community version 添加程序包会使项目始终以调试模式运行 - Adding a package causes project to always run in debug mode VS2015项目不会在调试模式下运行 - VS2015 Project wont run in debug mode 错误无法复制文件“obj\Debug\[project-name].dll”,因为找不到 - Error Could not copy the file "obj\Debug\[project-name].dll" because it was not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM