Forcing Correct Assembly Version 
Author Message
 Forcing Correct Assembly Version

Here is my problem, any help would be greatly appreciated:

I have a .exe that needs to load different versions of the same .dll

The directory structure looks like this:

/ main.exe
   1/test.dll
   2/test.dll
   3/test.dll

The version number is a variable in the exe and I load the dll using
the Activator class. The ExecuteLocation var holds the path to the
Assembly I want to execute:

        Dim assem As [Assembly]
        assem = assem.LoadFrom(ExecuteLocation)
        Dim types As Type() = assem.GetTypes

            Dim o As Object
            o = Activator.CreateInstance(types(0))
            MsgBox(o.GetType.Assembly.CodeBase)
        assem = Nothing

The MsgBox pops up the assembly path of the dll that was loaded.

The problem happens when I change the ExecuteLocation to a higher
version/folder number, it keeps loading the old one, even though the
assembly is being loaded from the new one.

It seems like the type name is being cached, even though I load the
type dynamically from the assembly I specify.

Any idea why this is happening?



Sun, 13 Mar 2005 01:47:59 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Unable to get correct assembly codebase when using COM+

2. Assembly Version Queston

3. Reflection assembly version recognition...

4. change Assembly version

5. Assembly Version Number into Label..

6. Simple Question: Executing Assembly Version Information

7. Assembly Version

8. DBEngine.version result is not correct

9. Whats slow about this code? (correct version)

10. Passing TableDef As a Parameter (correct version)

11. COM - accessing the correct class version in VB Script

12. help !!!bug in inetcomm.dll, but corrected in version 6.0.2600.0 so have question

 

 
Powered by phpBB® Forum Software