$(Gacutil) where is this defined, or "how does toolbar do gac deploy"?

Topics: Visual Studio Integration
Apr 12, 2011 at 8:21 PM

Using the toolbar, the cylinder icon looks like it deploys the current solution to the gac.

Great, except it doesnt work for me because the path it thinks it needs doesn't exist on my machine.

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\NETFX 4.0 Tools\GacUtil.exe /i "C:\s\EAI\ProductActivation\ProductActivation\obj\Debug\ProductActivation.dll" /f
I did some poking around and notice $(Gacutil) is used in the targets file, but I don't see anywhere that this property is defined?
Anyone know from how the toolbar is getting that path?
Apr 12, 2011 at 8:40 PM

I'm using Visual Studio 2010 on x64 Win2k8R2.

Looking at the Visual studio toolbar code, it appears it relies on the  registry value HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder

using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(VS2008KEY, false))
                {
                    return string.Format("{0}Bin\\NETFX 4.0 Tools\\GacUtil.exe", (string)rk.GetValue("CurrentInstallFolder"));
                }

The problem is, installing newer versions of the SDK doesn't seem to update this CurrentInstallFolder value - I have keys under ...\Windows for v6.0A, v7.0A, and v7.1...

Anyone else having this trouble?

In the meantime I can munge the CurrentInstallFolder value, but that may risk other tools that use these magic registry settings?

Coordinator
Apr 12, 2011 at 10:26 PM

Are you still running Visual Studio 2008 side-by-side?  If not, then you can definitely just update the CurrentInstallFolder path.  On a clean x64 box with only VS 2010 installed, the path will point to the v7.0A folder.  VS 2008 and 2010 include a version of the Windows SDK a bit different from the one you can download, and that's where the x.xA versions come from.  Looks like you downloaded and installed the latest SDK to get the v7.1 folder.

The purpose of the toolbar button is not to deploy anything.  It simply takes the output of the currently selected project and installs it into the GAC.  It might be useful for very quickly updating a helper assembly that just changed some internal logic, but it doesn't interact with BizTalk.  To actually deploy into BizTalk you need to use the right-facing arrow button or go through the Tools\Deployment Framework for BizTalk menu.

There's definitely some issue with this key and machines that have or used to have multiple versions of Visual Studio.  At this point, I'm not sure where to locate a better key for the path.

Thanks,
Tom

Apr 12, 2011 at 10:46 PM

Thanks for the reply Tom.

I do appreciate the purpose of that button, but I'm hoping all the buttons on that toolbar will work for my team before I tell them how wonderful BTDF is :)

Yes, I still have 2008 on this box, and yes I installed 7.1 today in hopes it might automagically update that registry value.

Any insight as to how $(gacutil) gets set when doing the MSBuild?

Anyway, if the BTDF toolbar is meant to work as part of an overall BTDF install, can you not just have it find gacutil in the same path as used by MSBuild:

"...Deployment Framework for BizTalk\5.0\Framework\DeployTools\gacutil.exe"? (I'm guessing this is what $(gacutil) eventually gets set to?).

That is, skip the whole registry key interrogation?

Coordinator
Apr 13, 2011 at 4:21 AM

Correct, that is what $(gacutil) is set to.  I guess that's just as good for the Visual Studio add-in.  I created an issue in the Issue Tracker.

Thanks!
Tom