Assemblies, Versioning, etc....

Okay Here I go...

I have a program which loads a bunch of DLLs at startup and uses them during the program. When the user serializes a file it uses the information from those DLLs. If I make any changes to the DLL then recompile the program that file will no longer load up because it is referencing the old DLL. So I need to make those old DLLs look at the new version of the same DLL (granted the new DLL has similar features to the old DLL).

I looked up a few things online but I was not sure if it was what I am looking for (talked about making strongly typed names and putting assemblies into the GAC). Hopefully somebody here can just point me in the right direction and maybe leave a bit of sample code or perhaps links to good tutorials. If any of you are out to make some good tutorials, this topic could use a lot more tutorialing. Hehe. Thank ahead of time!Big Smile

[942 byte] By [MishkinFaustini] at [2007-12-17]
# 1
Hello,

It sounds like you may be using the serialization support built into the CLR. The serialization support is used for serializing object graphs, rather that plain-old-data. As such, the assemblies that understand and declared those types must be available to the serialization portion of the runtime.

This is a feature of object serialization.

However, if you are using some other kind of design [not related to CLR Serialization], and you are asking about strong and loose assembly binding for types, then I would suggest looking into the Assembly.Load documentation on MSDN. [ http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemReflectionAssemblyClassLoadTopic.asp ]
If you control the loading of the assemblies, or override the existing load semantics, then you can redirect the loads to a different version of the assembly. As a caution, though - typically redirecting loads is used to find an assembly which was not discoverable for reasons other than simple version mismatching.
You can also use publisher policy to redirect assembly loads to a newer version of an assembly, appropriate.
http://samples.gotdotnet.com/quickstart/howto/doc/pubpolicy.aspx

Suzanne's Loader blog may also be helpful: http://blogs.msdn.com/suzcook/

Hope that helps,
Stephen [Microsoft Common Language Runtime: Security - Developer]
http://blogs.msdn.com/stfisher

StephenFisher-MS at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified