troubleshooting Question

How do I Install a .net 4.5 dll in GAC?

Avatar of itnifl
itniflFlag for Norway asked on
.NET ProgrammingC#System Programming
7 Comments1 Solution3030 ViewsLast Modified:
I have created an integration pack with C# for System Center Orchestrator 2012 that runs on Windows Server 2012 R2 that depends on Newtonsoft.Json which is in Newtonsoft.Json.dll. When I run the runbook I get:

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.

Exception: FileNotFoundException
Target site: LogIn.Execute

Stack trace:
   at MyClient.LogIn.Execute(IActivityRequest request, IActivityResponse response)

I first thought I could use Ilmerge to merge the dependent dlls together, and I used this guide to set this up automatically when compiling in Visual Studio 2013: http://www.hanselman.com/blog/MixingLanguagesInASingleAssemblyInVisualStudioSeamlesslyWithILMergeAndMSBuild.aspx

But when doing this, and including both the required dll and dependent projects for the merging - the compile and merge takes for ever. The reason is that several sub-projects use .net and all those dependencies need to be merged as well - which is alot.

So then I thought I might want to install the required dll into the GAC. I found http://camerondwyer.wordpress.com/2013/05/22/how-to-install-a-dll-to-the-gac-on-windows-2012-using-only-powershell-without-having-to-install-sdk-or-visual-studio/, but this installs into the .net 4 part of the gac I suppose, because it didn't fix my problem and the dll is compiled for .net 4.5 of what I can see.

The options I have is to be able to ilmerge without merging the whole .net or install the dll on the Orchestrator runbook server so that my integration pack can use it. Any suggestions?
ASKER CERTIFIED SOLUTION
itnifl
Programmer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 7 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros