Hi folks,
i've posted this with no response on a few other lists this week, and
would be extra grateful of any help..
I know .NET is supposed to solve dll hell, but I'm having trouble
getting my
assemblies to work the way I want them to.
I have 5 dlls in my winforms app, all strong named, and with versions
specified to 1.0.* in
assemblyInfo.cs for each project.
What I want to do periodically is replace any one of the dlls with a
new
build. However, when I do this, I get a FileLoadException with
additional
information:
"The located assembly's manifest definition with name 'MyDLL' does not
match
the assembly reference."
I'm guessing this is behaviour by design, and the assembly that
references
the updated one won't accept a new version. I can solve the problem by
recompiling all the assemblies in VS so that they pick up any updated
references,
but that is a pain, and just replacing one dll on the server is way
simpler,
if its possible.
How do I make the assemblies not be fussy about what version of
referenced
assemblies is loaded? i will obviously be sure that there is no change
in method signatures, and if there is a change, then replace all the
dlls that need to be updated at the same time.
Thanks
Tim
Peter Koen - 22 Oct 2003 13:24 GMT
tim@scootasp.net (Tim Mackey) wrote in news:3cd2211.0310220013.1595d86
@posting.google.com:
> Hi folks,
> i've posted this with no response on a few other lists this week, and
[quoted text clipped - 34 lines]
> Thanks
> Tim
You can either use a fixed version number or use bindingRedirect in a
config file to state what the new version of the assembly is:
in app.config:
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32"
name="Microsoft.Windows.SampleAssembly"
processorArchitecture="x86"
publicKeyToken="0000000000000000"/>
<bindingRedirect oldVersion="2.0.0.0" newVersion="2.1.0.0"/>
</dependentAssembly>
</dependency>

Signature
best regards
Peter Koen
-----------------------------------
MCAD, CAI/R, CAI/S, CASE/RS, CAT/RS
http://www.kema.at
Tim Mackey - 23 Oct 2003 10:35 GMT
hi peter,
thanks for the reply.
i looked around the .net docs and google and couldn't find what the
newversion and oldversion actually means. does it prevent or allow the
app running on the 'newversion' of the assembly?
can i specify 1.0.* as an allowed version? this way, i can release a
new build within 1.0.* and if i know it won't break the app, i want to
allow other assemblies referencing an older version to use the new
one.
the reason i want to do this is because i've written a very simple
library for my winforms apps that works like BITS (but doesn't use
BITS). it compares local assembly versions with those on a web server,
and downloads any udpated files, streamed through a web service. so if
i use fixed versions, and release an update with the same fixed
version, my updater won't spot that its new.
thanks for any tips
tim.
David Browne - 22 Oct 2003 15:05 GMT
> Hi folks,
> i've posted this with no response on a few other lists this week, and
[quoted text clipped - 7 lines]
> specified to 1.0.* in
> assemblyInfo.cs for each project.
You should never use 1.0.* for the assembly version. This will just break
your binding on every build. Use fixed version numbers for assembly
version, and increment assembly file version to keep track of minor changes.
David