解决方案中的网站“重建解决方案”编译成功不能启动调试器 [英] Web Site in solution where "Rebuild Solution" compile succeeds cannot launch debugger
问题描述
我有一个包含网站的解决方案(使用网站模板创建,而不是网络应用程序项目模板 - 转换不是一个选项,btw)。
I have a solution that includes a Web Site (created using the web site template not the web app project template - converting isn't an option, btw).
当我重建所有的,编译成功,但奇怪地显示3个错误,所有这些都是无法获得项目引用PROJNAME的依赖项。当我尝试启动调试器时,我得到有建立错误。对话。
When I rebuild all, the compile succeeds, but strangely displays 3 errors, all of which are "Could not get dependencies for project reference 'PROJNAME'". When I try to launch the debugger, I get the "There were build errors." dialogue.
两个问题:
- 如果我在调试错误对话框运行最后一次成功的构建,它会运行在我的Rebuild All刚刚编译的代码上吗?
- 如何解决这个问题?
我查了这个帖子,我的前景让我很沮丧。奇怪的是,我把这些相同的项目添加到编译/调试好的单独的网站解决方案中,删除了测试网站,并重新添加了我要调试的目标网站,并且以相同的方式失败。 .NET网站是否有一个秘密的网站.proj文件?
I checked this post and am disheartened by my prospects. What is strange, though, is that I added these same projects to a separate web site solution that compiled/debugged fine, removed the test web site and re-added the target website I would like to debug, and it failed in the same manner. Is there a secret web site .proj file for .NET web sites?
推荐答案
我浪费了一整天这个问题。要简要总结一下,我正在使用VS 2008进行遗留的网站项目,发布失败。我看着错误列表,看到可怕的无法获取依赖关系错误。我查看了这篇文章和其他与Stackoverflow和其他地方相关的帖子,并尝试了我发现的所有建议。当我重新安装Visual Studio 2008时,精神错乱达到顶峰,重新启动并看到错误重新出现。好的时候!
I wasted an entire day on this problem. To briefly summarize, I was working on a legacy "Web Site" project using VS 2008 and the publish failed. I looked at the Error List and saw the dreaded "Could not get dependencies" error. I looked at this post and other posts related to the error on Stackoverflow and elsewhere, and tried all suggestions that I found. The insanity peaked when I reinstalled Visual Studio 2008, rebooted and saw the error reappear. Good times!
第二天我意识到发布错误实际上是由目录权限引起的。构建错误与此无关。这是我从我的一天学到的东西:
The next day I realized the publish error was actually being caused by directory permissions. The build error had nothing to do with it. Here's what I've learned from my day of hell:
- 这是Visual Studio 2008网站项目中的一个错误,已经从时间,但显然不是固定的(截至1/2011)。当两个或更多的程序集项目具有依赖关系时,会出现两个或更多的程序集项目,然后两者都作为项目引用添加到网站。
- 除了这是一个错误,它是将问题分类为错误是不正确的。在我看来,这是一个警告级别的问题。最好的证据是它似乎并没有影响到构建,我能够在没有修复的情况下成功部署。
- 我强烈地认为应该跟踪所有错误和编译器警告下来,理解和消除。这是证明规则的例外。如果你可以找到一个解决方法,一切都可以使用它,并忘记错误信息!
- 最后但并非最不重要的是,这是为什么Web站点项目类型。
- This is a bug in Visual Studio 2008 web site projects that has been reported from time to time but is clearly not fixed (as of 1/2011). It occurs when 2 or more assembly projects have dependencies, one to the other, and then both are added as project references to the web site.
- In addition to this being a bug, it is incorrect to classify the problem as an error. It seems to me that it is a warning level issue. The best evidence for this is that it doesn't seem to affect the build, I was able to successfully deploy without fixing it.
- I believe strongly that all errors and compiler warnings should be tracked down, understood, and eliminated. This is the exception that proves the rule. If you can find a workaround, by all means use it and forget the error message!
- Last but not least, this is yet another reason why the "Web Site" project type in Visual Studio should be avoided at all cost.
这篇关于解决方案中的网站“重建解决方案”编译成功不能启动调试器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!