How to install a DLL to the GAC on Windows Server 2012 using only PowerShell (without having to install SDK or Visual Studio)

Yes, MS decided to make the developer’s life harder, but some of us didn’t notice for 2 more years. :(

How to install a DLL to the GAC on Windows Server 2012 using only PowerShell (without having to install SDK or Visual Studio).

UPDATE:

Depending on how hard your server is locked down, this may not work.

I wrote a script to register several components, and report on any exceptions. There were no exceptions, and the server’s exception logs didn’t register any exceptions, but nothing still got registered. My “echo”s did get sent back, so I know that the script executed all the way through. I had to hop through additional hurdles for that on security.

Bottom line, I tossed in the towel, and just copied all of the DLLs to the local bin directory of the executable, then manually registered the application as a windows service. Finally activated the service, and bing! It worked.

At the rate that MS is locking everything down, it is a good thing that MS is moving .NET to open source. I will be able to move my app’s front end and service end to Linux, and not have to deal with this any more.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.