Find correct fusion.dll

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
 
D

Dolly

//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
 
S

slx

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
 
M

Mattias Sjögren

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top