Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 May 26th, 2004, 02:26 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default Add reference to Global Assemblies

Please let me know how I can add reference to Global assemblies using Visual Studio .Net

_________________________
-Vijay G
Strive for Perfection
__________________
- Vijay G
 
Old May 26th, 2004, 02:34 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Right-Click on the project, click "Add Reference...". On the .Net tab, all assemblies that are in the GAC will show up in the list.
 
Old May 26th, 2004, 02:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Does it show even if I have 2 or more versions of same assembly and let me choose any of the versions I need?

_________________________
-Vijay G
Strive for Perfection
 
Old May 26th, 2004, 03:54 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Yes. It will show all versions that have been put in the GAC. For example: if you install two version of the framework, you'll see System.Web.dll in there with both the 1.0 and 1.1 versions.
 
Old May 26th, 2004, 03:58 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks a lot for your replies.

Can you please let me know, how do I do that using CODE, than adding reference from Menu? Is that possible, if so how?

Thanks again for the help.

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old May 26th, 2004, 04:04 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I'm not sure what you mean? How do you do what in code? Adding an assembly reference is a design-time operation. (Or a compile-time operation if you are using the command line compiler.)
 
Old May 26th, 2004, 04:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sorry for not being clear on that.

When I add reference using VS.net UI, this should add some referencing code to my project. Can I do the same by coding at DESIGN-TIME rather doing "Add reference" from the menu.
Just got to think too much.;)

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old May 26th, 2004, 04:15 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You can't "code" a reference. References are used when the code is compiled. When you add a reference to something in VS, you are telling the project about the desired reference. You end up with an entry in the project file that looks like this:

<Reference
  Name = "System"
  AssemblyName = "System"
  HintPath = "..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.432 2\System.dll"
/>

This allows VS to apply that reference when it compiles the code.

What's the problem with just using the "Add Reference..." feature in VS?
 
Old May 26th, 2004, 04:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks for the Reply.
No there isn't any problem in adding that using Add Reference.

As I could see that the reference is added to the project seeing the entry there, I just out of curiosity wanted to know if I can write that on my own instead of adding from menu.

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old May 26th, 2004, 07:53 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Well, I guess you could write something that modified the project XML file externally, and added a reference node to the file. Then you'd get a prompt in VS that the file has been changed externally, would you like to reload.





Similar Threads
Thread Thread Starter Forum Replies Last Post
need to add a reference to System.Net.Mail erik BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 January 9th, 2011 04:17 PM
Add a reference on Runtime anandham Pro VB 6 3 September 18th, 2006 09:16 AM
Cannot Add Reference ~Bean~ ASP.NET 1.x and 2.0 Application Design 1 June 20th, 2006 02:43 PM
vector.add(); -- Reference or Object? Firedawn Servlets 2 February 23rd, 2005 01:04 AM





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