Friday, November 16, 2007

How to install assembly to GAC on build event

I keep forgetting this line, and end up having to dig it out from other projects. I am putting it in here so that I can access it faster.

Basically, every time you build/rebuild your .NET assembly, it needs to be in the GAC for BizTalk to be able to use it. So, I put this code on the Build Events to move the assembly to the GAC.


"C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i $(TargetFileName)
there. Now I won't forget.

4 comments:

Anonymous said...

The following command seams better since VS installation folder may differ on different machines:

"$(DevEnvDir)..\..\SDK\v2.0\Bin\GacUtil.exe" /i "$(TargetPath)" /f

Good luck.

Arnulfo Wing said...

You are absolutely right. Thanks for this command line. I will be using it instead.!

Anonymous said...

$(FrameworkSDKDir) is even easier, it points to the C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0 dir.

Arnulfo Wing said...

Gerben, Thanks so much for your comment! It is indeed a lot shorter and easier to remember.!! Here is what the final line will be with your information:
"$(FrameworkSDKDir)bin\gacutil.exe" /i $(TargetPath) /f