CS1595 - defined in Multiple places; using definition

J

jhe

I have a user control HeaderControl which was shared by
multiple Asp.Net Pages (.aspx), sometimes when I make some
changes to our website and restart iis, it will have the
CS1595 error, but when I change something (for example,
add a space) in the HeaderControl.ascx, it will work
correctly. Here is the specific error message:

==============
Compilation Error
Description: An error occurred during the compilation of a
resource required to service this request. Please review
the following specific error details and modify your
source code appropriately.

Compiler Error Message: CS1595: '_ASP.HeaderControl_ascx'
is defined in multiple places; using definition
from 'C:\WINNT\Microsoft.NET\Framework\v1.0.3705\Temporary
ASP.NET Files\root\40a482a3\35b5c2ce\9tawcop3.dll'
=====================

Thank you in advance

Jhe
 
A

Alvin Bruney

The reason for this is you have the assembly in a couple places. If these
two assemblies were built by the same program and in those two places, the
framework cannot determine which one to use because they are both valid and
usable and so it throws the error.

I've had that happen if i have an assembly A being used by assembly B and
Assembly C had its own copy of assembly A. In that case, there were two
valid copies of assembly A floating around. I'm not even sure that this
scenario should result in an error either according to the docs.

As a first start, you can delete all these assemblies every where you find
them on your hard drive, flush iis temporary files, then rebuild that
particular assembly. You should now have only one copy of this assembly. I'm
sure there are other permutations of this problem as well. This is just a
fix that i happened upon. See if it works for you.
 
F

frank p

Is this flushing and deleting a done by something in IIS, a .NET tool
like gacutil or just hunting and deleting with Explorer?

Frank
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top