.net 将项目构建配置更改为调试模式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5379870/
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
Changing Project Build Configuration to Debug mode
提问by Ravneet
I am using VS 2008. I am getting a PopUp everytime i run my application.
我正在使用 VS 2008。我每次运行我的应用程序时都会得到一个弹出窗口。
Following is the PopUp:
以下是弹出窗口:
The following module was built with optimizations enabled or without debug information :
C:\Windows\Microsoft.Net\Framework\v2.0.50727\Temporary ASP.NET Files\rootc06d97f\c871fca3\assembly\dl3ed1f335d7b454_9450ca01\BArcodingImaging.DLLC:\Windows\Microsoft.Net\Framework\v2.0.50727\Temporary ASP.NET Files\rootc06d97f\c871fca3\assembly\dl3ed1f335##代码##d7b454_9450ca01\BArcodingImaging.DLLTo debug this module, change its project build configuration to debug mode. To suppress this message, disable the "Warn inf no user code on launch" debugger option.
以下模块是在启用优化或没有调试信息的情况下构建的:
##代码##要调试此模块,请将其项目构建配置更改为调试模式。要禁止显示此消息,请禁用“启动时警告 inf 无用户代码”调试器选项。
I have tried all the links available on the Google to get rid of this error but nothing works. Actually most of the links are for VS 2005. But i am using VS 2008.
我已经尝试了谷歌上所有可用的链接来摆脱这个错误,但没有任何效果。实际上大部分链接都是针对 VS 2005 的。但我使用的是 VS 2008。
I used following reference: http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/1946cf16-ae70-4394-9cd9-9d35f3f012ed/And one on Code Guru.
我使用了以下参考:http: //social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/1946cf16-ae70-4394-9cd9-9d35f3f012ed/和 Code Guru 上的一个。


回答by Nicolas Raoul
1) Click on the menu Tools > Settingsand select Expert Settings
2) A new menu called Buildhas appeared. In it, select Configuration manager
3) In Active solution configuration, click New...as shown below:
1) 单击菜单Tools > Settings并选择Expert Settings
2)Build出现了一个名为的新菜单。在里面,选择Configuration manager
3) 在 中Active solution configuration,点击New...如下图:


4) Type Debugas a name and select to copy from Release, as shown below:
4)Debug输入名称,选择复制自Release,如下图:


5) In your project's properties, at the top of the Buildtab, a configuration selector has now appeared. Mark the Define DEBUG constantand Define TRACE constantas checked. In Advanced, change Debug Infofrom noneto full.
5) 在您项目的属性中,在Build选项卡的顶部,现在出现了一个配置选择器。将Define DEBUG constant和标记Define TRACE constant为已选中。在 中Advanced,Debug Info从none变为full。
As you see, it is a real pain... I find Monodevelopmuch easier to use.
如您所见,这真的很痛苦……我发现Monodevelop更容易使用。
回答by Petar
It seem that in my configuration all have bben set correct with debug ON, but I have too this problem. It is fix with this steps:
似乎在我的配置中所有 bben 设置正确,调试开启,但我也有这个问题。通过以下步骤修复:
- Stop my local IIS
- Close all visual studios
- Check directory cache from your message when start to debug
- delete this directory For was this path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\eventsservice\5d285bc1
- Start again your IIS
- Rebuld projects, solutions Done!
- 停止我的本地 IIS
- 关闭所有视觉工作室
- 开始调试时从您的消息中检查目录缓存
- 删除此目录对于此路径:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\eventsservice\5d285bc1
- 重新启动你的 IIS
- Rebuld 项目,解决方案 完成!
The problem may be becouse in your solution have project with the diferent framework version. Check this too and set it correctly. All project that are reference between must use the same framework version.
问题可能是因为您的解决方案中有不同框架版本的项目。也请检查并正确设置。相互引用的所有项目必须使用相同的框架版本。
回答by JonnyReeves
This one caught me out, and having learnt Visual Studio the hard way (ie: just diving in) it wasn't clear how to change the 'Active' build configuration to 'Debug'. This can be done by selecting Configuration Managerfrom the BuildMenu and then selecting 'Debug' from the Active solution configuration pulldown menu.
这个让我很惊讶,在艰难地学习了 Visual Studio(即:只是潜入)之后,不清楚如何将“活动”构建配置更改为“调试”。这可以通过Configuration Manager从Build菜单中选择然后从活动解决方案配置下拉菜单中选择“调试”来完成。
回答by Vinicius Ottoni
Ignore the message.
忽略消息。
The solution (that works for me) was simple:
解决方案(对我有用)很简单:
Go to Tools --> Options --> Debugging --> General
转到工具 --> 选项 --> 调试 --> 常规
At this point, unselect 'Enable Just My Code (Managed Only)'.
此时,取消选择“仅启用我的代码(仅限托管)”。
Attach the process again, and be happy.
再附上过程,开心就好。
回答by grmbl
FYI, when having the service being installed under account Local System I could debug without ever needing to change anything. I needed to change the account to Network Service and now I have the mentioned dialog. Tried above, none worked...
仅供参考,当在帐户本地系统下安装服务时,我可以调试而无需更改任何内容。我需要将帐户更改为网络服务,现在我有提到的对话框。上面试过了,都没有用...
回答by Tom Stickel
Short answer: I am not using vs 2008 , but with vs 2010 sp1 , I re-opened and it worked (I feel I got lucky).
简短回答:我没有使用 vs 2008 ,但是使用 vs 2010 sp1 ,我重新打开并且它起作用了(我觉得我很幸运)。
Long Answer: I'm using vs 2010 sp1 , and tried several things, I was going to delete the dll from my path error C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2c0d3658\caacfa0a\assembly\dl3\53e39126\e888ca9f_7252cc01 INSTEAD I SHUTDOWN visual studio and IIS EXPRESS I stopped .... Then I re-opened the project and things were fine. I thought I have a 10-25% chance of it fixing itself... but it fixed itself just fine.
长答案:我正在使用 vs 2010 sp1 ,并尝试了几件事,我打算从我的路径错误中删除 dll C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\ 2c0d3658\caacfa0a\assembly\dl3\53e39126\e888ca9f_7252cc01 相反,我关闭了visual studio 和IIS EXPRESS 我停止了......然后我重新打开了项目,一切都很好。我以为我有 10-25% 的机会可以自行修复……但它可以自行修复。
回答by iugs88
回答by Scott Yang
In my case, this problem was caused by the incorrect setting about debugging in VS2012. I ever carelessly unchecked the checkbox "Always load symbols located next to modules, then I got the same Popup message box like your picture.
就我而言,这个问题是由于VS2012中调试设置不正确引起的。我曾经不小心取消了复选框“始终加载位于模块旁边的符号,然后我得到了与您的图片相同的弹出消息框。
the checkbox location: TOOLS->Options->Debugging->Symbols->Specify modules.
复选框位置:TOOLS->Options->Debugging->Symbols->Specify modules。
I give a picture below to show how to resolve it, hope it will be helpful.
我在下面给出了一张图片来展示如何解决它,希望它会有所帮助。


回答by soreron
Clear the dll from the GAC. Do a rebuild and try again. I was getting the exact message (except for the actual dll name ) so I checked where the dll was built to and compared this path to the path in the 'Driver' or Caller app. Then I removed the dll from the GAC did a rebuild and set appropriate breakpoints. VS doesn't automatically update the version number on the dll so it was looking for a different version to the one I was debugging.
从 GAC 中清除 dll。进行重建并重试。我得到了确切的消息(除了实际的 dll 名称),所以我检查了 dll 的构建位置,并将此路径与“驱动程序”或呼叫者应用程序中的路径进行了比较。然后我从 GAC 中删除了 dll 进行了重建并设置了适当的断点。VS 不会自动更新 dll 上的版本号,因此它正在寻找与我正在调试的版本不同的版本。

