Shared Dlls and Recompiling

B

Ben Mann

Hi There,

Im currently working on a project with another developer. We've making two
websites, both of which will share a common code library.

Though the library is quite complete, we still find extra bits that need
adding to it from time to time.
Both web projects have the dll set up as a reference, but when that dll is
recompiled, the web projects do not seem to notice that the dll is a newer
version. We have to delete the reference and re-reference the dll.
I thought that the versioning of components ha dbeen cleared up a bit with
..Net, over the old COM model.

Am i missing something?

Thanks.

Ben Mann.
 
N

Nick Wienholt

Where is the DLL loaded from? If you drop a new copy in the bin directory
of the website and the DLL is not strongly named or strongly named and
bindings to redirect to the new version are in place, a new AppDomain will
be created by ASP.NET, and new requests will be routed to this new
AppDomain, and once the old AppDomain has finished serving any active
requests, it will be unloaded.

Nick Wienholt, MVP
Maximizing .NET Performance
http://www.apress.com/book/bookDisplay.html?bID=217
Sydney Deep .NET User Group www.sdnug.org
 
R

rs_tiin

hi

Do note that the runtime will always load the version of
the Referenced assembly, which the client application was
originally built with . In your case when you build a
client app with a common code dll version 1.x(irrelevant
of GAC base Shared or Private Assembly), and deploy it.
Even if you update the GAC with a newer version lets say
2.x, the client app(in ur case the web site) will bind to
the version 1.x only, as this was the version it was built
with

That said, One solution for this problem is to rebuild ur
client app with the new version of the common code lib,
which is wat u r doing anyways.

A better option would be to use the bindingRedirect
element in the app.config/web.config file so as to
redirect any request for the version1.x to version 2.x.

Look up the help for bindingRedirect element in MSDN. Do
post/mail in case u have more queries

hth

regards,

sr
 

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