CS0006: Metadata file "../bin/WebApplication1.dll" could not be found

  • Thread starter Thread starter John Doe
  • Start date Start date
J

John Doe

Hi,

I've got the following error when building my ASP.NET application called
WebApplication1:

Preparing resources...
Updating references...
Performing main compilation...
error CS0006: Metadata file
'c:\inetpub\wwwroot\WebApplication1\bin\WebApplication1.dll' could not be
found
Build complete -- 1 errors, 0 warnings

I cannot Rebuild the whole application, just Build seems to work. My
breakpoints are not hit all the time in the debugger and I suspect something
is really wrong with the build. Therefore, I do need to rebuild the whole
solution.

In the Solution Explorer I see a reference to webapplication1 - I imagine
this is normal, although I don't perfectly understand my WebApplication1
project has a reference to itself...

I've been looking on the web for possible solutions, but the only thing I
found had something to do with gacutil, which I think doesn't apply in my
case. WebApplication1.dll does not exist in the bin directory when I try to
rebuild (being the cause of the error), so how could I register it in the
GAC? And would I then have to update the GAC everytime my assembly changes?

Can somebody please help me out?

Thank you.
 
Thanks that seems to work, however is it safe to drop the reference
completely, or is it worth restoring it now?
 
It is safe to drop the reference. A web app shouldn't have a reference
to itself - that must have been a mistake when it made it into the
project.
 
I didn't explicitly add the reference, it probably got added when I added my
Web custom control to the Toolbox.
It is quite common to add a toolbox item for custom controls implemented in
your current application, which makes me think Visual Studio should have
detected that.
 
I didn't explicitly add the reference, it probably got added when I added my
Web custom control to the Toolbox.
It is quite common to add a toolbox item for custom controls implemented in
your current application, which makes me think Visual Studio should have
detected that.
 
Back
Top