开发者

Web Site in solution where "Rebuild Solution" compile succeeds cannot launch debugger

开发者 https://www.devze.com 2022-12-23 05:48 出处:网络
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).

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).

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.

Two questions:

  1. If I choose the 'Yes' option in the debug error dialogue to run the last successful build, will it run on the code that my Rebuild All just compiled?
  2. How do I resolve this issue?

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 mann开发者_JAVA技巧er. Is there a secret web site .proj file for .NET web sites?

Could not get dependencies for project reference


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:

  1. 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.
  2. 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.
  3. 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!
  4. Last but not least, this is yet another reason why the "Web Site" project type in Visual Studio should be avoided at all cost.


Are you working with some king of unmanaged, platform-specific code? I get that kind of errors a lot when I'm developing on a x64 machine and my code depends on x86 libraries. The only way I know of running a website depending on x86 code on a x64 machine is to use IIS and disable x64 support on the application pool, this will force the use of the .NET x86 environment and your dependencies will run fine.

Even if that's not your case, try to install IIS on your machine and attach to his process, instead of using the built-in web server. This should eliminate most of the debugging issues.


The rebuild operation "succeeding" and at the same time displaying errors sounds like a real problem. These should be mutually exclusive results.

The short answer to fixing your problem is that you need to resolve the errors. Based on the debugger UI the build is not actually succeeding (regardless of what's being reported). You must fix this problem in order to debug the new code.

Can you elaborate more on the scenario?

  • Do you have more than one project in the solution?
  • Do all of them succeed in building?
  • For the errors what project do they refer to and can you give us any additional information here.
0

精彩评论

暂无评论...
验证码 换一张
取 消