p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   .NET Framework 3.5 (http://p2p.wrox.com/net-framework-3-5-355/)
-   -   Installing assemblies into the GAC under .NET 3.5 (or 4.0) (http://p2p.wrox.com/net-framework-3-5/79187-installing-assemblies-into-gac-under-net-3-5-4-0-a.html)

mhkay April 26th, 2010 07:35 AM

Installing assemblies into the GAC under .NET 3.5 (or 4.0)
 
Under .NET Framework 2.0 I generally add assemblies to the GAC using the "Microsoft .NET Framework 2.0 Configuration" tool reached via the control panel / administrative tools. There doesn't seem to be an equivalent under 3.5. What's the reason for this, and what should one use instead?

Michael Kay

samjudson April 26th, 2010 08:10 AM

I'd use the command line tool gacutil.exe.

gacutil /i <assembly>

mhkay April 26th, 2010 08:29 AM

Thanks for the reply, Sam. But I gather gacutil.exe is only available if you have installed .NET development tools; what if you only have the runtime? (I'm looking here for advice to give to people installing Saxon on .NET).

I've also read that you can simply drag files into c:/windows/assembly but it doesn't work for me: I get "access not allowed".

samjudson April 26th, 2010 08:33 AM

Ah yes - in that case I believe simply copying the file to the C:\Windows\Assembly directory in windows explorer should do the trick.

Imar April 26th, 2010 08:40 AM

3.5 and 2.0 use the same run-time, so I can imagine you can use the 2.0 tool for 3.5 assemblies as well....

Or is the whole tool missing?

When you get "access not allowed", are you running as a non-admin on Windows 7 or other UAC OS?

Imar

mhkay April 26th, 2010 09:52 AM

yes, the 2.0 tool works with 3.5 - and I've been using it - but new users who install 3.5 without having 2.0 installed don't get the tool.

The "access denied" message when trying to update the GAC from Windows Explorer happens even if I start Explorer using "Run as administrator".

Imar April 26th, 2010 11:22 AM

It looks like Microsoft is making it harder and harder to do this. According to this:

http://msdn.microsoft.com/en-us/library/dkkx7f79.aspx

you have four options.

Mscorcfg.msc (phased out), Gacutil.exe (dev machines only), Windows Installer and the special Assembly folder.

I am getting the same Access Denied error message for most assemblies I tried, including my own siged ones. I dragged a few existing Silverlight design assemblies from Dev Express into that folder and I got no error message (but didn't see the assemblies either).
Could this be a 64 bit versus 32 bit thing?

That leaves only the installer, which seems like way too much overkill to me....

Imar

samjudson April 26th, 2010 11:53 AM

According to the following page the Explorer view on the Assembly does not run with elevated privileges even if you run Explorer with elevated privileges. You need to actually log in as an Administrator.

http://msdn.microsoft.com/en-us/library/34149zk3.aspx

The 'recommended' way is via an installer, but as Imar says this sounds a bit like overkill.

mhkay April 26th, 2010 12:35 PM

Thanks for all the help. Falling foul of the crazy Vista permissions system again. The KB entry says "To run the viewer with elevated permissions, log on as a local administrator." But I am a local administrator; usually if I want to do something privileged, it asks for confirmation, but here it just denies access.

I guess I ought to be developing an Installer for Saxon.NET to make this easier for people. It feels like a lot of effort - and more significantly, a lot of testing on different Windows versions, which is a logistical nightmare.

Thiggonionlly November 11th, 2010 07:59 AM

I think it's best to install Net Framework 3.5 as it's the latest version but if you want to install 2.0 the steps will be similar to those below. You will get 3.5 anyway through Windows Updates if you install 2.0 because it will detect that you have an old version.

Before installing Net Framework make sure that you have Windows Installer 3.1 - it's a requirement to be able to install Net Framework. If you don't have it you can get it from the following link. If you're not sure try downloading it anyway as it will detect that it's already installed if you have it already.


All times are GMT -4. The time now is 04:12 AM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.