views:

4986

answers:

5

Typically what I used to do is drag and drop the files onto the GAC folder.
This works in Windows 2000 & 2003, however when I try to do this in Windows Server 2008 I get 'Access is denied'.

The user that is doing this is a local administrator.

The only reference I can find to this is: Forum link

Is there another way to achieve this?

Note: I tried running explorer as the administrator, but I get the same error.

Edit: Ideally whatever solution there is should not turn off UAC, or install any software development kit. (So it can be applied to production servers).

Edit: Does anyone have anymore thoughts on this? I've currently on gone with disabling UAC in dev, however this is unacceptable in live.

+3  A: 
Aamir
Thanks for the feedback but, visual Studio will never be installed on these servers. I'll look into the gacutil method.
Bravax
Surely there's a better approach then that? Wouldn't that mean that every time we need to update the GAC we need to turn off the UAC, reboot make the change, then turn it back on, and reboot again?
Bravax
Yes and the better approach is to have .NET framework SDK installed. A normal user will not be playing with GAC, right? So, if you want to play with GAC, you need to have the privileges to do so. .NET command prompt simply provides you those privileges.
Aamir
And further, in Windows 2008 even a Local System Administrator needs some extra privileges to do certain things. Adding an assembly to GAC is one of those things.
Aamir
Ok, but that would mean that at some point we'll need to install the .net framework sdk on a production server. Isn't that a bad idea?
Bravax
Shouldn't it be enought to issue the above command from an elevated command prompt? A reboot or switching off UAC should not be required.
0xA3
Sure, but in order to issue the command I need to install the SDK which I definately don't want to do on a production server.
Bravax
What a nightmare. I would seriously question the "security" reasoning behind either forcing the UAC to be turned off or installing the full SDK on a production box.
Chris Lively
The '/if' switch has changed in the latest versions of gacutil, now it is listed as an alias to '/i' so I assume the functionality it the same, I have listed more complete steps to resolve this in my answer.
ahin4114
A: 

I've never tried it in Windows Server 2008, but have you tried from Control Panel / Administrative tools / .NET Framework 2.0 Configuration ?

Eduardo Campañó
That doesn't exist on Windows Server 2008.(Well not in that location, or that I can find.)Sadly i'm new to Windows Server 2008 too...
Bravax
See this post: http://blogs.pointbridge.com/Blogs/pagnusat_tony/Pages/Post.aspx?_ID=13 , it's not a clean solution but it seems to work
Eduardo Campañó
Surely there's a better approach then that? Wouldn't that mean that every time we need to update the GAC we need to turn off the UAC, reboot make the change, then turn it back on, and reboot again?
Bravax
Installing the .NET Framework SDK and use the command Aamir suggests. Sorry I can't imagine anything else right now.
Eduardo Campañó
No problem, thanks for your help, I appreciate it.
Bravax
+1  A: 

This is a UAC issue in server 2008, some people have recommended stopping UAC, I would not recommend this on a production server. The answer is to use gacutil.

You do not need to install the SDK to run this on a production server, the exe and its config file can be deployed from a development machine (and removed after use if desired).

Place gacutil.exe and gacutil.exe.config into the WINDOWS\Microsoft.NET\Framework\ folder specific to the version of the framework you are using.

Then start a new instance of the command line using "Run as administrator"

Navigate to the C:\WINDOWS\Microsoft.NET\Framework.... folder where you have deployed gacutil

Then run: gacutil.exe /i

Hopefully this should resolve your issue (it has worked for me).

Good luck.

ahin4114
+1  A: 

Run a command prompt with "Run as Administrator". Execute command "explorer C:\windows\assembly". This window accepts drop of DLL's from another explorer executed with "Run as administrator privileges.

Hope it helps

Paulo Oliveira
A: 

If you change the Local Security Policy on the Win2008 server (or Win7), you can use the old drag/drop method:

http://blogs.msdn.com/b/mossbiz/archive/2010/06/10/add-an-assembly-to-the-global-assembly-cache-on-windows-server-2008-r2.aspx

ermurri