Find correct fusion.dll

  • Thread starter Thread starter slx
  • Start date Start date
S

slx

The knowledge base article
http://support.microsoft.com/default.aspx?scid=kb;en-
us;317540 describes how a custom setup program can install
assemblies into the gac. The main entry function
CreateAssemblyCache is implemented in fusion.dll. But how
do I find the correct version of fusion.dll at runtime?
After installing the preview of .NET 1.2 (Whidbey) you
have to use the version of fusion.dll that ships with
Whidbey. Otherwise a call to InstallAssembly returns an
E_NOINTERFACE.

Does anybody know any better method to find the correct
version than scanning the subdirectories of
C:\WINNT\Microsoft.NET\Framework and taking the one with
the highest version number?

Thanks for help
 
//C#
using System.Reflection;

String ver = Assembly.GetExecutingAssembly().GetName
().Version.ToString();

'VB
Imports System.Reflection;

Dim ver As String = [Assembly].GetExecutingAssembly
().GetName().Version.ToString()


HTH,
Dolly
 
Hi Dolly,

the problem is not to get the version of the .NET
framework within a .NET app, it's to get the version of
the win32 based GAC API you have to use from a standard
legacy win32 app.

slx
 
the problem is not to get the version of the .NET
framework within a .NET app, it's to get the version of
the win32 based GAC API you have to use from a standard
legacy win32 app.

You could call mscoree!GetCORSystemDirectory, I believe it returns the
path of the latest framework version if you haven't loaded any other
version into the process.



Mattias
 
Back
Top