3

Possible Duplicate:
How to add a dll to gac in vista

I have changed my OS to Windows 7 from Windows xp. I am trying to put the DLL in Windows 7 assembly folder but I am unable to do so. I am getting Access Denied error alert.

Please let me know how to drag and drop a DLL in Windows 7 assembly.

Community
  • 1
  • 1
RHM
  • 351
  • 2
  • 7
  • 20
  • You aren't supposed to drag and drop DLLs into the Global Assembly Cache (GAC). What are you trying to do? – Cody Gray - on strike Feb 28 '11 at 10:39
  • possible duplicate of [How to add a dll to gac in vista](http://stackoverflow.com/questions/53057/how-to-add-a-dll-to-gac-in-vista). As suggested in the answers to that question, you need [Gacutil.exe](http://msdn.microsoft.com/en-us/library/ex0ss12c.aspx) to do this, or preferably an install program. – Cody Gray - on strike Feb 28 '11 at 10:43
  • As everybody else has suggested, use GacUtil. – Pradeep Feb 28 '11 at 11:04
  • This is a common issue that a lot of developers have run into (that isn't necessarily fixed by disabling UAC). It is also the top google hit for this issue. I really am getting sick of people closing every question they don't personally find useful on this site. The vista answer linked as a duplicate does not work for this case. – Kelly Robins Nov 02 '15 at 18:21

1 Answers1

2

Have you tried starting Windows Explorer as Administrator?

Even if your user account has admin rights you still need that elevation for such tasks.

If this doesn't work, I suggest you use gacutil.exe. You also have to open the command prompt as administrator then:

  1. In start menu find the link to the command prompt of your visual studio installation. If this isn't your development machine you need the SDK or just copy gacutil.exe.
  2. Right click the command prompt shortcut and choose "run as administrator".
  3. In the command prompt you type gacutil /i "assembly_path". Or type gacutil /? for an explanation how to use it.
mono68
  • 2,080
  • 19
  • 27
  • @Cody Gray: In Windows XP you may use the Explorer to simply drag an assembly to the %WINDIR%\assembly folder. I always do so since it works fine and is much simpler than using gacutil.exe. – mono68 Feb 28 '11 at 11:02
  • Even if you could do it like this, you aren't supposed to. Not in Windows XP, and still not in Windows 7. Read the [documentation](http://msdn.microsoft.com/en-us/library/dkkx7f79.aspx); you'll notice it doesn't say *anything* about drag-and-drop. The fact that you *can* do something doesn't mean that you *should*. – Cody Gray - on strike Feb 28 '11 at 11:03
  • Please tell me how to start windows explorer as administrator, I am logged in to windows as admin, does that work? – RHM Feb 28 '11 at 11:05
  • @RHM: That suggestion is nonsense. Use the proper tools for the job you're trying to do. See the comments to your question. – Cody Gray - on strike Feb 28 '11 at 11:11
  • 1
    @Cody - unless that page has been updated since you posted your comment, it does mention dragging to install - in the highlighted note discussing `Shfusion.dll`, and how it's obsolete for .Net framework 4 (though presumably still valid for lower versions) – Damien_The_Unbeliever Feb 28 '11 at 11:20
  • @Damien: Okay, fair enough. It does say *something* about it. But then it also says it's obsolete. I'd call that "winning on a technicality", wouldn't you? ;-) Moreover, the answer doesn't mention anything about using `shfusion.dll`, it just says you should run Explorer as an elevated process. That's not the correct solution. – Cody Gray - on strike Feb 28 '11 at 11:22
  • Okay, rather than arguing whether it is not the correct solution I just edited my post to provide something that probably might be considered a valid solution but most of all will hopefully help RHM. – mono68 Feb 28 '11 at 11:41