Wednesday, February 1, 2012

“Access Denied” : Add an assembly to the Global Assembly Cache on Windows Server 2008 R2

Hello friends

I encountered one error when I was trying to deploy DLL to GAC, it always throws error “Access Denied” , it was really frustrating. The problem was UAC(User Account Control)  which does not allow to deploy to GAC.
I tried below things to solve problem, BUT all failed

1>      Start a cmd prompt with “Run as administrator” and they typing the “explorer” GAC window and from where DLL we need to deploy and tried to deploy there still same error.
2>      “Disable” UAC. FAIL

I have checked about the Local Polices related GAC.

Here is an entire list of local policies related to UAC.

User Account Control: 

Run all administrators in Admin Approval Mode. It was Enabled on their server. It means that any action that should only be achievable by an administrator must go through UAC’s “Admin Approval”. 

Now we need to “disabled” this means  that Admin Approval Mode is no longer required for members of the local Administrators group… effectively disabling UAC entirely for those users.

Then I Rebooted (required changes to the local security policy).

Now it works…Hip Hip Hurray.

IMPORTANT: Disabling this can make it easier for malware to compromise your system. I encourage this to be disabled only temporarily so that the specific actions required may be taken, then re-enabled (along with the associated reboot) immediately at completion.

Disha Shah


  1. You can open cmd prompt as an administrator and copy the files using the command line to GAC without issue.

  2. I have solve the Similiar error in Metalogix Migration tool and its Solution in :