Replacing strong-named assembly

S

Stefan

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
 
B

Bruce Barker

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

Stefan

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

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top