.NET 4: GAC’ing Assemblies Made Simple

Installing assemblies into the GAC is no longer straight forward. In the good ol’ days it used to be as simple as dragging a file into the Assembly folder. Or using the gacutil.exe. Neither is available any longer.

According to various posts out in the wild wild web, the updated .NET 4 version of gacutil.exe is for dev purposes only and should not be used in a production environment. It says so here, and I believe everything posted on the internet. The recommended approach of using a Setup and Deployment InstallSheild (Limited Edition) installation project also has it’s issues; the out of the box version installed with VS 2012 is not usable without downloading a new version, downloading a new version requires you to register, registration is a hassle, and the dude doesn’t abide hassles.

So … is there another option?

You betcha.

Are you going to tell me what it is?

If you ask nicely.

Okay, what’s the other option?

Check out PowerShellGac on CodePlex. It contains several useful ps scripts for getting assemblies into and out of the GAC. This was the best option I found.

The documentation on CodePlex is good enough to get you going, however when running the Install-Module command, I had to do: Install-Module .\Gac instead of Install-Module Gac. No big whoop.

Is there a catch?

Not really. If I had one wish for Christmas this year, just one wish, this set of scripts would allow for deployments of assemblies to various staging and production servers remotely. In order to use these powershells they need to be deployed to each server and run individually.

Are there other options?

Great question. Do you know of a better method or better scripts? Is there an easier way to install remotely? Comment up, people.

*EDIT*: I’ve finally had a moment to check into powershell remoting. It’s fairly straight forward. The one catch is remoting must be enabled on your various machines. Take a look at this TechNet post for more informaiton.



The power compels you ...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: