Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 3.5 and Visual Studio. 2008 > .NET Framework 3.5
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 26th, 2010, 07:35 AM
mhkay's Avatar
Wrox Author
Points: 18,225, Level: 58
Points: 18,225, Level: 58 Points: 18,225, Level: 58 Points: 18,225, Level: 58
Activity: 66%
Activity: 66% Activity: 66% Activity: 66%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,924
Thanks: 0
Thanked 281 Times in 276 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
Reply With Quote
  #2 (permalink)  
Old April 26th, 2010, 08:10 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,133
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?
Reply With Quote
  #3 (permalink)  
Old April 26th, 2010, 08:29 AM
mhkay's Avatar
Wrox Author
Points: 18,225, Level: 58
Points: 18,225, Level: 58 Points: 18,225, Level: 58 Points: 18,225, Level: 58
Activity: 66%
Activity: 66% Activity: 66% Activity: 66%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,924
Thanks: 0
Thanked 281 Times in 276 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
Reply With Quote
  #4 (permalink)  
Old April 26th, 2010, 08:33 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,133
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?
Reply With Quote
  #5 (permalink)  
Old April 26th, 2010, 08:40 AM
Imar's Avatar
Wrox Author
Points: 71,154, Level: 100
Points: 71,154, Level: 100 Points: 71,154, Level: 100 Points: 71,154, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,944
Thanks: 79
Thanked 1,554 Times in 1,531 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!
Reply With Quote
  #6 (permalink)  
Old April 26th, 2010, 09:52 AM
mhkay's Avatar
Wrox Author
Points: 18,225, Level: 58
Points: 18,225, Level: 58 Points: 18,225, Level: 58 Points: 18,225, Level: 58
Activity: 66%
Activity: 66% Activity: 66% Activity: 66%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,924
Thanks: 0
Thanked 281 Times in 276 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
Reply With Quote
  #7 (permalink)  
Old April 26th, 2010, 11:22 AM
Imar's Avatar
Wrox Author
Points: 71,154, Level: 100
Points: 71,154, Level: 100 Points: 71,154, Level: 100 Points: 71,154, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,944
Thanks: 79
Thanked 1,554 Times in 1,531 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!
Reply With Quote
  #8 (permalink)  
Old April 26th, 2010, 11:53 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,133
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?
Reply With Quote
  #9 (permalink)  
Old April 26th, 2010, 12:35 PM
mhkay's Avatar
Wrox Author
Points: 18,225, Level: 58
Points: 18,225, Level: 58 Points: 18,225, Level: 58 Points: 18,225, Level: 58
Activity: 66%
Activity: 66% Activity: 66% Activity: 66%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,924
Thanks: 0
Thanked 281 Times in 276 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
Reply With Quote
  #10 (permalink)  
Old November 11th, 2010, 07: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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 10: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



All times are GMT -4. The time now is 05:35 PM.


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