Add Reference problems again...

R

Rob R. Ainscough

This is definitely a major weak spot in VS 2005 .NET development. It was a
big problem in VS 2003 and apparently has carried over to VS 2005. It
really should NOT be this complicated (it wasn't prior to .NET).

I've got a several core DLL references (class libraries) that I've added to
a Web application/solution. I try to build the solution and I get the
following:

Error 1 Unable to load referenced library
'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\MyWebApp\e3bfad37\_shadow\5c6fe0e9\bin\1\MyCompanyName.Web.Utilities.dll':
The system cannot find the path specified.

I get a bunch of these errors for each of my core class library references
I've added to the web solution. I have NO idea what this directory is nor
why VS 2005 is even looking in this mysterious directory for any of my
DLLs -- I certainly didn't put them there.

These are then obviously followed up with a series of these errors:

Error 25 Type 'MyCompanyName.Web.Common' is not defined.
c:\inetpub\wwwroot\MyWebApp\App_Code\MyService.asmx.vb 68 30
http://localhost/MyWebApp/

because of the references that are "missing" from first slew of errors.

None of my code is currently under Source Control. If anyone has a solution
on the "correct" way to add References, please let me know. I've tried all
variations and none produce a clean working environment. What I'm trying to
accomplish is pretty simple, I retain a core set of DLLs (class libraries)
that live in a dir D:\NET Core\... and a web application that lives in
C:\inetpub\wwwroot\WebApp -- I've added references to pointing to D:\Net
Core and VS 2005 starts to go crazy and copy these core file everywhere (see
the mysterious "_shadow" directory) -- my questions

1. Why does VS 2005 copy files all over the place? Can this be prevented?
If so, how?
2. Why can't VS 2005 simply use the referenced DLL where I originally
specified?
3. When VS 2005 builds a debug or release for my web app, why can't it copy
the files it needs for final output and put them in the bin (rather than
creating all these hidden tempory ASP.NET dirs)?
4. What is the correct way to add a reference to my class libraries DLLs
and keep those references intact?

Fortunately I've read about many many other developers running into the same
situation. Apparently Microsoft has some "vision" about how this reference
process is supposed to work, but forgot to tell anyone about it.

Rob.
 
R

Rob R. Ainscough

I did find a sorta solution, but still no real understanding as to why I had
the problem in the first place. The "mystery" solution is to:

1. Select Property page for the web application (i.e.
http://localhost/MyWebApp)
2. Select "References"
3. Select all the listed DLLs and click the Update button

This removed all of the build errors.

It will be a nightmare when I actually have to add my code to Source
Control -- I've read about making sure NOTHING in my bin directory gets
added to source control. Not sure how this is supposed to my development
easier -- seems to have just over complicated this issue. So much so that I
think I'll just run command line compiles from now on and control it that
way. Good documentation of what VS 2005 does in this area is severly
lacking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top