0

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?

Rob Bowman
  • 7,632
  • 22
  • 93
  • 200
  • How are you verifying that it hasn't been published? – Ian Jan 21 '15 at 16:04
  • I check the .Net 4 GAC "C:\Windows\Microsoft.NET\assembly\GAC_MSIL". When I publish with Powershell my assembly appears here. I've also checked the .Net 2 GAC at "c:\windows\assembly" – Rob Bowman Jan 22 '15 at 11:51

1 Answers1

0

Reboot of server solved the problem

Rob Bowman
  • 7,632
  • 22
  • 93
  • 200