![]() |
|
|
|||||||
![]() |
ASP Net - Replacing strong-named assembly |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hi,
I have an application that consists of multiple strong-named assemblies like: App.exe references Utils.dll (for simplicities sake) All assemblies are strong-named, but not GAC'd (private assemblies). My goal is that once I have deployed App.exe, I want to deploy a bugfix in Utils.dll and redeploy this dependent assembly _without_ redeploying App.exe. Let's assume the interface of the types in Utils.dll have not changed. I thought that I could redeploy my new strong-named Utils.dll along with an codebase directive in App.exe.config redirecting to the new assembly to use (and ignore the old one). E.g: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Utils" publicKeyToken="f6a8ba1bc21a01be"/> <codeBase version="1.0.2081.19103" href="file://c:/program files/myapp/hotfix/20050909/Utils.dll"/. </dependentAssembly> </assemblyBinding> </runtime> <configuration> I don't get this to work. The error message I get is: "The located assembly's manifest definition with name 'Utils' does not match the assembly reference." Quite frankly I'm not sure if redirecting assembly bindings work at all for strong-named assemblies or only work for weakly-named assemblies. Can anyone help me out here? Thanks -Stefan Stefan |
|
|
|
|
#2 |
|
Posts: n/a
|
asp.net does not support codebase directives.
-- bruce (sqlwork.com) "Stefan" <> wrote in message news: ups.com... > Hi, > > I have an application that consists of multiple strong-named assemblies > like: > > App.exe references Utils.dll (for simplicities sake) > > All assemblies are strong-named, but not GAC'd (private assemblies). > > My goal is that once I have deployed App.exe, I want to deploy a bugfix > in Utils.dll and redeploy this dependent assembly _without_ redeploying > App.exe. > > Let's assume the interface of the types in Utils.dll have not changed. > I thought that I could redeploy my new strong-named Utils.dll along > with an codebase directive in App.exe.config redirecting to the new > assembly to use (and ignore the old one). E.g: > > <configuration> > <runtime> > <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> > <dependentAssembly> > <assemblyIdentity name="Utils" > publicKeyToken="f6a8ba1bc21a01be"/> > <codeBase version="1.0.2081.19103" href="file://c:/program > files/myapp/hotfix/20050909/Utils.dll"/. > </dependentAssembly> > </assemblyBinding> > </runtime> > <configuration> > > I don't get this to work. The error message I get is: > > "The located assembly's manifest definition with name 'Utils' does not > match the assembly reference." > > Quite frankly I'm not sure if redirecting assembly bindings work at all > for strong-named assemblies or only work for weakly-named assemblies. > > Can anyone help me out here? > Thanks > -Stefan > |
|
|
|
#3 |
|
Posts: n/a
|
Does it support bindingRedirect?
|
|
|
|
#4 |
|
Posts: n/a
|
i believe so, but there can only be one version of the dll in the bin
folder. the .net model is to just drop the updated dll into the bin folder, and the site reloads with the new code, while current requests run with the old dll. asp.net copies the bin folder to a shadow directory (which the code actually runs from), so that the dll will not be in use. also unless you are worried about malious updates of your dll, there is no need for strong names either. -- bruce (sqlwork.com) "Stefan" <> wrote in message news: ups.com... > Does it support bindingRedirect? > |
|
|
|
#5 |
|
Posts: n/a
|
Thanks, Bruce. I got it working with bindingRedirect.
The shadow copying happens after the dependency has been resolved (which is when the bindingRedirect comes into play) And yes, without the strongnaming everything would be much simpler by just copying the assemblies in the bin folder. But there is no way around for me to not strong-name the assemblies (since they are also used in other scenarios other than asp.net apps which require strong-naming). |
|