views:

13544

answers:

5

Hi

I want to run regasm.exe from cmd. which is avalable 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?

+6  A: 

In command prompt:

SET PATH "%PATH%;%SystemRoot%\Microsoft.net\framework\2.057"
Charlie Somerville
Better still: SET PATH "%PATH%;%SystemRoot%\Microsoft.NET\Framework\v2.0.50727"
Ries
Thanks for that
Charlie Somerville
A: 

I use the following in a batch file:

path C:\Windows\Microsoft.NET\Framework\v2.0.50727
regasm httpHelper\bin\Debug\httpHelper.dll /tlb:.\httpHelper.tlb /codebase
pause
Patrick
+2  A: 

You don't need the directory on your path. You could put it on your path, but you don't NEED to do that.
If you are calling regasm rarely, or calling it from a batch file, you may find it is simpler to just invoke regasm via the fully-qualified pathname on the exe, eg:

c:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm.exe   MyAssembly.dll
Cheeso
+2  A: 

Like Cheeso said:

You don't need the directory on your path. You could put it on your path, but you don't NEED to do that. If you are calling regasm rarely, or calling it from a batch file, you may find it is simpler to just invoke regasm via the fully-qualified pathname on the exe, eg:

%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\regasm.exe MyAssembly.dll

Ries
A: 

I use this as PostBuildscript in VS.

call "%VS90COMNTOOLS%vsvars32.bat"
regasm $(TargetPath) /tlb

Unrumpf