Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 3.5 and Visual Studio. 2008 > .NET Framework 3.5
|
.NET Framework 3.5 For discussion of the Microsoft .NET Framework 3.5.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 3.5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2010, 07:35 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default 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
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 26th, 2010, 08:10 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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

gacutil /i <assembly>
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old April 26th, 2010, 08:29 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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".
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 26th, 2010, 08:33 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Ah yes - in that case I believe simply copying the file to the C:\Windows\Assembly directory in windows explorer should do the trick.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old April 26th, 2010, 08:40 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 26th, 2010, 09:52 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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".
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 26th, 2010, 11:22 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old April 26th, 2010, 11:53 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

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.
__________________
/- Sam Judson : Wrox Technical Editor -/

Think before you post: What have you tried?
 
Old April 26th, 2010, 12:35 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old November 11th, 2010, 08:59 AM
Thiggonionlly
Guest
 
Posts: n/a
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuration files in GAC with .NET 3.5 prajip .NET Framework 3.5 8 June 19th, 2008 04:56 PM
Installing non-assembly files in the GAC eadred .NET Framework 1.x 0 April 28th, 2006 09:12 AM
HELP! Visual Studio locks assemblies for ASP.NET p bobmwaldo VB.NET 0 November 21st, 2003 11:44 AM
How to refer assemblies which are in GAC ? kishore_peddi C# 0 October 12th, 2003 09:09 AM
Linking to Net Assemblies Dave BOOK: Beginning ASP.NET 1.0 6 June 11th, 2003 05:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.