Shared assembly error.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a class library project and the output dll (MyLib.dll) is strong named
and it is deployed in GAC . I have a web application (MyWeb) that is using
the MyLib.dll. The problem I am faciing is, whenever I make modification to
my class library (MyLib.dll) I will put that into GAC (first by uninstalling
and then by installing the newly complied one) and then I physically copy
MyLib.dll into the bin directory of MyWeb. Whenever I try to access the web
application (MyWeb) I am gettign the following error

Exception Details: System.IO.FileLoadException: The located assembly's
manifest definition with name 'MyLib' does not match the assembly reference.

THis is happening every single time. Only way to tackle this is, I have to
recompile the web application (MyWeb) and as soon as I do this the error is
going away.

But I do not have to compile the client, that is the whole point of the
story right?. Am i missing sometthing here?...

Any help would be highly apprecited.

Thanks
 
Raja,


I would first check following things,

1. Version of the file Mylib.dll in a GAC and version of the file MyWeb
application is refering to ?

ILDASM on MyWeb application output dll you will see the metadata
information for MyLib.dll including version.


2. Check for any any version policy set after compilation of MyLib.dll?

3. How are you referencing mylib.dll in web application (Myweb) ?
If you are manually adding the reference and giving the path to the bin
directory then you should not do that as you are adding MyLib.dll in a GAC

4. If you are doing step 3 then check references section of web applicaiton
and find out the reference of MyWeb.dll and click F4.
This will open properties if Copy local attributes is true then make it false.

HTH
 
Hi Harish,
Thanks for your reply. Yes I am referencing the assembly the way you
described in Point 3. How do I reference otherwise?. And how to avoid this
error in my m/c.

Thanks
 
Back
Top