To Reference or not to Reference?

 

My questions are numbered in bold for easier answering...

I'm taking over an existing asp.net web app and have a question on references. When I right-click the web project and check the property pages, there are several dll references listed, some with a type BIN and others with a type GAC. 1) Why are some of listed in the web.config but others aren't?

All the referenced dlls physically exist in the bin folder, including some third-party controls as a GAC type. I removed those GAC references, thinking they weren't needed because they physically exist in the bin folder. And sure enough, the web app continues to work. (All those listed in the web.config are now gone.) 2) Was I wrong to remove the third-party control references, even though the project still works?

Three of the GAC references were: "stdole", "System.Design", "System.Windows.Forms". I removed them and everything still runs. 3) Was it fine to remove these? If so, why were they there in the first place? What is the stdole.dll file?

To me, it seems you should reference a dll only if it exists outside of your project, yet when I try to remove the BIN references, I get a message saying this is a source-controlled Web item and asking if I want to delete it in source control. That seems to indicate it will remove the dll from the bin folder, which I don't want, so I cancel the action. 4) Why won't it let me remove these, even though it let me remove the GAC third-party controls that are in the bin folder?

When I publish the site, I want all the dlls included, and that appears to be the case. But before I move it to production, I want to make sure it was ok to remove the references. To me, they seemed redundant, but I'm fairly new to asp.net and thought I'd better ask.

 

0
JDYoder
2/14/2008 10:19:28 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

1 Replies
1193 Views

Similar Articles

[PageSpeed] 32
Get it on Google Play
Get it on Apple App Store

JDYoder:

I'm taking over an existing asp.net web app and have a question on references. When I right-click the web project and check the property pages, there are several dll references listed, some with a type BIN and others with a type GAC. 1) Why are some of listed in the web.config but others aren't?
When some assemblies are used through out the applictaion. we reference them in the web.config, so that we do not have to reference them in each page again and again. Hence only some are referenced in web.config. Also The assemplies registered in GAC is noramlly regisered in Web.config with the storng name

All the referenced dlls physically exist in the bin folder, including some third-party controls as a GAC type. I removed those GAC references, thinking they weren't needed because they physically exist in the bin folder. And sure enough, the web app continues to work. (All those listed in the web.config are now gone.) 2) Was I wrong to remove the third-party control references, even though the project still works?
Yes. You should always try to use the Reference from The GAC if possible. This will help in sharing the assembly(dll) with many application and also changing the assemply.

Three of the GAC references were: "stdole", "System.Design", "System.Windows.Forms". I removed them and everything still runs. 3) Was it fine to remove these? If so, why were they there in the first place? What is the stdole.dll file?
As answered before, You should try to use the reference in the GAC.

To me, it seems you should reference a dll only if it exists outside of your project, yet when I try to remove the BIN references, I get a message saying this is a source-controlled Web item and asking if I want to delete it in source control. That seems to indicate it will remove the dll from the bin folder, which I don't want, so I cancel the action. 4) Why won't it let me remove these, even though it let me remove the GAC third-party controls that are in the bin folder?

When I publish the site, I want all the dlls included, and that appears to be the case. But before I move it to production, I want to make sure it was ok to remove the references. To me, they seemed redundant, but I'm fairly new to asp.net and thought I'd better ask.


Vikram
www.vikramlakhotia.com


Please mark the answer if it helped you
0
vik20000in
2/15/2008 4:17:54 AM
Reply:

Web resources about - To Reference or not to Reference? - asp.net.getting-started

European Terrestrial Reference System 1989 - Wikipedia, the free encyclopedia
The European Terrestrial Reference System 1989 ( ETRS89 ) is a ECEF (Earth-Centered, Earth-Fixed) geodetic Cartesian reference frame , in which ...

Microsoft dismisses iPad Pro as “a companion device” and references old Steve Jobs stylus quote
... to be a companion device.” Laycock also said that “at one point in time, Apple declared that if there’s a stylus, that’s failure” – a reference ...

New York Times Removes Reference to President Obama and Cable News
... — Noah Rothman (@NoahCRothman) December 18, 2015 The Times story was published Thursday, but by Friday morning, the reference to cable news ...

Can you spot these classic film references hidden in Pixar movies?
The animators at Pixar definitely love to throw in allusions to some of their favorite movies in their own films. Vimeo user Jorge Luengo Ruiz ...

Here's how to remove all Donald Trump references when you're online
... screen, a new Google Chrome extension can help. Here's how the Trump Filter works. The extension " searches the web pages you visit for references ...

See The Classic Movie References Found In Pixar's Greatest Films
... all well aware of just how clever Pixar movies are. These emotionally engaging stories are full of intricate themes and crammed with references ...

Zootopia Trailer Adds a Godfather Reference to Disney Film - Collider
Watch a new trailer for the Disney animated movie Zootopia, which takes place in a world inhabited by talking animals and features Jason Bateman ...

Hillary Clinton Ends Democratic Debate With A Star Wars Reference
The other day, President Obama ended his White House press conference with a reference to The [...]

Review: Klipsch X20i Reference In-Ear Headphones
These Klipsch X20i Reference In-Ear Headphones are pretty darn fantastic, and worth every penny.`

O’Malley References How Old Clinton And Sanders Are While Explaining His ISIS Strategy
O’Malley References How Old Clinton And Sanders Are While Explaining His ISIS Strategy

Resources last updated: 1/15/2016 3:25:08 PM