Code to obtain the path of ILDASM.exe

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi,

I can use System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
to obtain the path for ILASM.exe, but how can I obtain the path to
ILDASM.exe?

Examples of the path I'm looking for are:
VSNET 2002 - "C:\Program Files\Microsoft Visual Studio
..NET\FrameworkSDK\Bin"
VSNET 2003 - "C:\Program Files\Microsoft Visual Studio .NET
2003\SDK\v1.1\Bin"


Thanks

Sam
 
Hi William,

I know about the Visual Studio .net 2003 command prompt, but I wish to
obtain the path in code in a dot net application. Any other ideas?

Thanks

Sam
 
Hi Sam,

Did you try this?
\\\
Dim psi As New ProcessStartInfo
psi.FileName = "Your path"
psi.UseShellExecute = True
Process.Start(psi)
///
 
Sam,
I know about the Visual Studio .net 2003 command prompt, but I wish to
obtain the path in code in a dot net application. Any other ideas?

Look in the registry, grab the string value

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv1.1

I believe the value was named "sdkInstallRoot" for v1.0. Then append
"bin\ildasm.exe" to the path. Since one can have multiple versions of
the SDK installed, you have to be prepared to select one of them.



Mattias
 
Hi Mattias,

Thanks for the information. This is exactly what I was looking for.
The only thing that I need to know now is which one to use based on if
I'm using VisualStudio 2002 or Visual Studio 2003.

I'll be writing an addin that will use this information and some users
will run VS 2002 or VS 2003. So depending on which one a user is
running I will need to build an appropriate path string to ILDASM.EXE.

Do you know of a way to programmatically determine which version of
Visual Studio.Net is being used?

Many Thanks,

Sam
 
Sam,
Do you know of a way to programmatically determine which version of
Visual Studio.Net is being used?

From within an add-in, you can check DTE.Version.



Mattias
 
Back
Top