My program should call ILASM , but it continues to move through me. Is there a registry setting or other value that my program can read, so I donβt need to hardcode the path?
ILASM
In the Microsoft.Build.Utilities SDK namespace, you can use the ToolLocationHelper class :
using Microsoft.Build.Utilities; // Use ToolLocationHelper to find ILASM.EXE in the Framework directory ToolLocationHelper.GetPathToDotNetFrameworkFile("ILAsm.exe", TargetDotNetFrameworkVersion.VersionLatest);
Adapted from the MSDN sample .
It seems that there are several libraries that look like ILAsm that people have recommended:
You can use these (or CodeDom β C #) instead of calling the program.
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft.NETFramework, find InstallRoot. Add the .net version number to the path in InstallRoot and get it.