E
EmeraldShield
Ok, this is what I am trying to do...
I am trying to build a CheckForUpdates type feature into my app.
I want to enumerate all the versions of my DLL that are in the GAC (It has
to be in the GAC for reasons too long to go into here).
Then I just want to pull out the version numbers and call my site over SOAP
to see if any of them need updates.
It would appear that there are NO functions to enumerate all the versions of
your DLL installed. Or am I missing something?
This could will work if it is local, but not from the GAC.
Assembly vdb = Assembly.Load("MyDll.DLL");
Console.WriteLine(vdb.GetName().Version.ToString());
Console.WriteLine(vdb.GlobalAssemblyCache ? "GAC" : "Local");
Console.WriteLine(vdb.Location.ToString());
If I give it all the specifics of my DLL:
Assembly vdb = Assembly.Load("MyDLL, Version=3.21.3.18, Culture=Neutral,
PublicKeyToken=dfc935gge21123461");
It will load THAT ONE version, but no others. If I add an app.config file
to map them all together:
<bindingRedirect oldVersion="0.0.0.0-3.21" newVersion="3.21.3.18"/>
It still will not work.
How does Explorer do it? If I navigate to C:\windows\assembly I can see
each and every version of the DLL that is installed.
MyDll 3.10.x.x
MyDll 3.11.x.x
MyDll 3.13.x.x
MyDll 3.18.x.x
Whatever. I can't figure out how to do this...
I am trying to build a CheckForUpdates type feature into my app.
I want to enumerate all the versions of my DLL that are in the GAC (It has
to be in the GAC for reasons too long to go into here).
Then I just want to pull out the version numbers and call my site over SOAP
to see if any of them need updates.
It would appear that there are NO functions to enumerate all the versions of
your DLL installed. Or am I missing something?
This could will work if it is local, but not from the GAC.
Assembly vdb = Assembly.Load("MyDll.DLL");
Console.WriteLine(vdb.GetName().Version.ToString());
Console.WriteLine(vdb.GlobalAssemblyCache ? "GAC" : "Local");
Console.WriteLine(vdb.Location.ToString());
If I give it all the specifics of my DLL:
Assembly vdb = Assembly.Load("MyDLL, Version=3.21.3.18, Culture=Neutral,
PublicKeyToken=dfc935gge21123461");
It will load THAT ONE version, but no others. If I add an app.config file
to map them all together:
<bindingRedirect oldVersion="0.0.0.0-3.21" newVersion="3.21.3.18"/>
It still will not work.
How does Explorer do it? If I navigate to C:\windows\assembly I can see
each and every version of the DLL that is installed.
MyDll 3.10.x.x
MyDll 3.11.x.x
MyDll 3.13.x.x
MyDll 3.18.x.x
Whatever. I can't figure out how to do this...