Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Performance / July 2004

Tip: Looking for answers? Try searching our database.

Best way To Reference Shared Assembly?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Mohan - 16 Jul 2004 03:04 GMT
Hi,
I've built an assembly that's going to be deployed to the global assembly cache of a few servers and I'm wondering what the best way to reference it is?

I've deployed the assembly to my local machine's GAC and currently reference it in an app's web.config file within the compilation\assemblies element.

Is it better to add a section name handler for the assembly's type/namespace within the machine.config file?  If i do this will i still have to add a reference within each apps web.config file?

The web.config reference:
ie:
<assemblies>
----<add assembly="MyAssembly, Version=1.0.2411.0,
---------- Culture=neutral,
---------- PublicKeyToken=xyzpdq1234"/>
</assemblies>

Any advice is appreciated although a response of "don't put it in the GAC put it in the bin dir" isn't what I'm looking for.
Miha Markic [MVP C#] - 16 Jul 2004 12:23 GMT
Add the assembly reference to References?

Signature

Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

> Hi,
> I've built an assembly that's going to be deployed to the global assembly cache of a few servers and I'm wondering what the best way to reference it
is?

> I've deployed the assembly to my local machine's GAC and currently reference it in an app's web.config file within the compilation\assemblies
element.

> Is it better to add a section name handler for the assembly's type/namespace within the machine.config file?  If i do this will i still
have to add a reference within each apps web.config file?

> The web.config reference:
> ie:
[quoted text clipped - 5 lines]
>
> Any advice is appreciated although a response of "don't put it in the GAC put it in the bin dir" isn't what I'm looking for.
Chris Mohan - 16 Jul 2004 12:37 GMT
THanks.. but I need a solution that isn't specific to Visual Studio.  Adding a reference by using the "Reference" property of a project stores the information in the .vbproj file which is autogenerated by visual studio.

> Add the assembly reference to References?
>
[quoted text clipped - 21 lines]
> > Any advice is appreciated although a response of "don't put it in the GAC
> put it in the bin dir" isn't what I'm looking for.
Miha Markic [MVP C#] - 16 Jul 2004 12:48 GMT
Then add the reference at compile time...

Signature

Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

> THanks.. but I need a solution that isn't specific to Visual Studio.  Adding a reference by using the "Reference" property of a project stores the
information in the .vbproj file which is autogenerated by visual studio.

> > Add the assembly reference to References?
> >
[quoted text clipped - 21 lines]
> > > Any advice is appreciated although a response of "don't put it in the GAC
> > put it in the bin dir" isn't what I'm looking for.
Chris Mohan - 16 Jul 2004 13:02 GMT
Thanks but can you elaborate?  I think if I knew what you meant I would not have the need to post my question. I'd like to know how rather in addtion to when.

How would I go about "add(ing) the reference at compile time"?

> Then add the reference at compile time...
>
[quoted text clipped - 32 lines]
> GAC
> > > put it in the bin dir" isn't what I'm looking for.
Miha Markic [MVP C#] - 16 Jul 2004 14:13 GMT
Hi Chris,

See csc /reference compiler option it lets you add a reference to an
assembly at compile time.

Signature

Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

> Thanks but can you elaborate?  I think if I knew what you meant I would not have the need to post my question. I'd like to know how rather in
addtion to when.

> How would I go about "add(ing) the reference at compile time"?
>
[quoted text clipped - 34 lines]
> > GAC
> > > > put it in the bin dir" isn't what I'm looking for.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.