Permissions to Add Assemblies to the GAC

Originally posted by Nick Heppleston at:

I received an interesting error today while setting up a new TeamCity build-server. When running the MSBuild Microsoft.Sdc.Tasks GAC uninstall task – GlobalAssemblyCache.GacHelper.Uninstall – I kept receiving the following error:

C:SubversionTrunkBizTalkBuildCommon-DeploymentCommonDeployment-Cleanup.proj(59, 3): A task error has occured.
Message = Failed to uninstall CandidateMarks.Canonical, PublicKeyToken=1b76b267b587386b from the GAC. AssemblyName = CandidateMarks.Canonical, PublicKeyToken=1b76b267b587386b

at Microsoft.Sdc.Tasks.GlobalAssemblyCache.GacHelper.Uninstall(String name)
at Microsoft.Sdc.Tasks.GlobalAssemblyCache.RemoveAssembly.InternalExecute()
at Microsoft.Sdc.Tasks.TaskBase.Execute()

It turns out that the user attempting to uninstall or install assemblies to the GAC needs write permissions to the %systemdrive%WindowsAssembly directory (as documented here and here). Adding that user to either the local computer Power Users or Administrators Group provides the necessary permissions and the above error is no longer an issue.


Leave a Reply

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

You are commenting using your 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