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

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

Scott Allen

Try removing the assembly reference to WebApplication1.dll and then
rebuilding.
 
J

John Doe

Thanks that seems to work, however is it safe to drop the reference
completely, or is it worth restoring it now?
 
S

Scott Allen

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

John Doe

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

John Doe

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top