Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 manner. Is there a secret web site .proj file for .NET web sites?

Could not get dependencies for project reference

like image 699
fordareh Avatar asked Feb 27 '23 09:02

fordareh


1 Answers

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.
like image 157
Paul Keister Avatar answered Mar 01 '23 23:03

Paul Keister