I want to run regasm.exe from cmd. which is available in c:\windows\Microsoft.net\framework\2.057
I do like this c:\ regasm.exe
It gives regasm is not recognized as internal or external command.
So I understood that I need to set the path for regasm.exe in environment variable.
For which variable do I need to set the path to run regasm as described above?
Execute only 1 of the below
Once a command works, skip the rest/ below to it:
Normal:
Only if you face issues, use old version 'v2.0.50727':
Only if you built myTest.dll for 64bit Only, use 'Framework64' path:
Note: 64-bit built dlls will not work on 32-bit platform.
All options:
See https://docs.microsoft.com/en-us/dotnet/framework/tools/regasm-exe-assembly-registration-tool
I really dislike the hard coding of paths to get to regasm, when you install a new .Net or run on a machine with a different version, you need to ensure you find a version of regasm. Here's a solution to find the regasm.exe from the most current .Net installed regasm.
Within a bat file:
Outside of a bat file (i.e. command prompt), just use
%a
instead of%%a
For the 64-bit RegAsm.exe you will need to find it someplace like this:
By dragging and dropping the dll onto 'regasm' you can register it. You can open two 'Window Explorer' windows. One will contain the dll you wish to register. The 2nd window will be the location of the 'regasm' application. Scroll down in both windows so that you have a view of both the dll and 'regasm'. It helps to reduce the size of the two windows so they are side-by-side. Be sure to drag the dll over the 'regasm' that is labeled 'application'. There are several 'regasm' files but you only want the application.