10

I sometimes need to run gacutil.exe or installutil.exe, etc. from the command line. Is it OK to add the .NET framework directories to my system PATH? If so, which ones should I add and in which order?

5 Answers 5

6

Sure, nothing wrong with that. First thing I did once I got tired of digging out installutil and/or gacutil. You should only need to add:

%WINDIR%\Microsoft.NET\Framework\v2.0.50727

or

%WINDIR%\Microsoft.NET\Framework64\v2.0.50727

...depending on whether or not you want 64bit utilities or not. Typically you don't need to add 3.0 or 3.5 directories and they are really just add-ons for 2.0.*

3

I always add the following to my path:

  1. C:\Windows\Microsoft.NET\Framework\v3.5
  2. C:\Windows\Microsoft.NET\Framework\v2.0.50727

I sometimes need to compile on the command line when I write simple stuff and also to use gacutil and regasm.

1

It's a fine thing to do. Works great on my dev machines. I also add the Windows SDK so I can use ildasm from anywhere.

C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

As for the order of the paths, typically the first path that contains the matching command is the winner.

1

just be aware that some utilities like gacutil (I know this for sure at least with the 2.0 framework) isn't always available on every computer with the framework installed. I've seen some servers where I work that don't have it and we had a script that needed it :) Bad situation to be in.... but for development, you should be fine.

0

I find it too useful to do it, in order to call msbuild from the command line in any directory.

I use to add just this directory: %WINDIR%\Microsoft.NET\Framework\v3.5

Not the answer you're looking for? Browse other questions tagged or ask your own question.