Rob Bowman
Rob Bowman

Reputation: 8701

gacutil fails to deploy to gac

I have a .net 4 c# library that I would like to publish to the .net 4 GAC as a post build event.

I have added "$(SolutionDir)BTS.GO.Core.Deployment\ExternalAssemblies\gacutil.exe /i "$(TargetPath)"

Problem is, gacutil is run, no error is reported but the assembly is not published to the GAC. There are no errors in the event log.

When trying gacutil directly from the command line I have 7 different versions of gacutil on my laptop and I have tried all of them. Some complain about the version but most just present a blank line.

However, if I use the following powershell script then the assembly is published correctly:

    Set-location "c:\Folder Path"            
    [System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")            
$publish = New-Object System.EnterpriseServices.Internal.Publish            
$publish.GacInstall("c:\Folder Path\DLL.dll")            

Any ideas why GACUtil would fail like this?

Upvotes: 0

Views: 514

Answers (1)

Rob Bowman
Rob Bowman

Reputation: 8701

Reboot of server solved the problem

Upvotes: 0

Related Questions