473,496 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VS2005 Add Reference

I'm running into some oddball behavior that I hope is not by design.

When I add a reference (via Add Reference) to the bin folder, some, but not all, of the assemblies referenced by the assembly I'm
adding are also added. Example:

Support.dll depends on Splash.dll, DesignTime.dll, License.dll and LicenseDesignTime.dll. Adding a reference to Support.dll brings
in Splash, License and LicenseDesignTime.

I don't want Splash brought in, although I do need License and LicenseDesignTime. If I delete Splash, it gets re-added on the next
compile.

Why is VS2005 adding some but not all of the subsidiary references?

- Mark
Feb 11 '06 #1
11 2710
Hi Mark,

Welcome to the MSDN newsgroup.

As for the "Add reference" function in VS 2005 ide, are you adding the
reference of a certain assembly by directly pointing to its assembly
file(dll) on the disk rather than reference the assembly's project? If so,
the VS ide will check the assembly's metadata for any dependency and search
the assembly's current directory, if any dependency also exists there, it
will also be copied to ASP.NET web application's private bin dir. For
example, suppose we have the following assemblies:

clslib1.dll , clslib2.dll, clslib1dep.dll

clslib2.dll depend on clslib1.dll, and clslib1.dll depend on clslib1dep.dll.

In our ASP.NET web application, we use the "add reference" to reference
that clslib2.dll assembly, if at that time clslib1.dll and clslib1dep.dll
are also in the same directory, they'll also be copied to the bin dir.
Elsewise, if clslib1.dll or clslib1dep.dll is not found in the same
directory with clslib2.dll, it won't be copied.

In addition, for strong-named assemblies, they're not copied to local bin
dir, the ASP.NET web project will add the reference by adding an entry in
the web.config file(in the compilation/assemblies element), like:

<compilation debug="false">
<assemblies>
...........
BTW, all these above are the VS ide specific behavior. At runtime, .net
framework clr will always probing through its assembly locating rules(from
GAC to local probing path).

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Feb 13 '06 #2
Steven,

Yes, I am browsing to the DLL, and not using the Projects tab. Having to include the same project into every website I build so that
I can avoid having all these extraneous references dragged in is not something I want to do.

Well, I see this is yet another change in VS2005 that makes little or no sense to me, and causes me more, not less, work. Sheesh.

- Mark
Feb 14 '06 #3
Thanks for your followup Mark.

Yes, such behavior may not meet all kinds of our requirement, however the
vs 2005 ide's reference control can only ensure that it help add those
existing dependencis it can find. If there is other requirements on
optionally add some dependencies and not all, we may need to do it
manually.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 14 '06 #4
But how do you do it manually? Every time I try to add just a single assembly, the silly IDE drags the referenced assemblies along.

Is there some switch I'm not seeing? Or some other option for adding just a specific assembly? All I'm looking at are the options on
the context menu that comes up when you right-click the Bin folder.

- Mark
Feb 16 '06 #5
Hi Mark,

So far I haven't known any buildin swtich or setting which can change this
behavior. VS IDE will always try finding reference's dependency and add
them automatically. BTW, why don't yout to want to copy those dependency?
At runtime, the application will need to load those dependency, if not
existing, there will occur runtime error.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 20 '06 #6
Steven,

They just clutter up the bin directory, and the Types defined in them never get called by the website application. In ASPNET1.1 I
would just not include them as references without any problem.

- Mark
Feb 21 '06 #7
Thanks for your followup Mark,

If so, I'm afraid we have to manually remove those items if you do not want
them since VS IDE won't know whether your actual scenario will need to
manually remove those dependency. It always think dependency are necessary
and I think this is the reasonable behavior.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 22 '06 #8
Steven,

Unfortunately, you can't remove them...if you do, VS2005 adds them back in on the next compile.

What I don't understand is why this behavior was changed from VS2003. That earlier version didn't add in the dependent references
automatically.

- Mark
Feb 22 '06 #9
Thanks for followup Mark,

I think this change is originally designed to make gathering dependency
assemblies more conveniently, however, seems dosn't meet your concrete
scenario's requirement. BTW, one possible means to automate the removing
assembly task is add another c++ makefile project and add the removing
certain assembly task in it. In the whole solution, make this make file
project's build sequence behind your Application project(which reference
those assemblies).

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Feb 23 '06 #10
Steven,

Will that work in a C# project, too?

- Mark
Feb 23 '06 #11
Hi Mark,

For c# library project, it has pre/post build events itself, for some other
projects like ASP.NET web project, it lack of such events. So we may need
to use such a c++ make file project to simulate the build events. The
following kb article has mentioned this:

http://support.microsoft.com/kb/810230/en-us

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Feb 24 '06 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5136
by: Jody Gelowitz | last post by:
Is this possible? I have compiled an assembly in VS2005 and am trying to add a reference to that assembly from my VS2003 project. The error that I am getting is: A reference to '{path to vs2005...
6
1579
by: jhcorey | last post by:
Hello, I'm trying to figure out how to reference a web service from a VS2005 web site project. I know how to do this in VS2003. I've been combing msdn for samples, but I've only found the...
15
4182
by: Joseph Geretz | last post by:
OK, I'll admit it up front - I just don't get it. Here's our previous VS2003 development model. Developers develop the WS solution on their own workstations, using their own IIS web servers...
2
5681
by: Tammam | last post by:
Hello All, I had a solution composed of managed/unmanaged C++ , C# projects. It builds with no problem in VS2003 but after converting the solution to VS2005 i get many linking errors such as...
4
1497
by: WXS | last post by:
In a case you have Project/Assembly A references Project/Assembly B which References Project/Assembly C. Let's say Project A needs be and references it directly. Unknown to A, B needs project C's...
4
1313
by: DaTurk | last post by:
Hi, I'm converting our code base into VS2005 and we have alot of Managed c++. Problem is, is that for some reason some of our code will compile, but doesn't run correctly in VS2005. So, as we...
0
1476
by: SenthilVel | last post by:
Hi All I have problems when i convert my 1.1 ASPX web application to 2.0 using VS2005. My web application gets compiled fine in CLR1.1 and there is no problem with that. When i do the...
2
1731
by: Ravikanth | last post by:
I created a web application in vs2003 which cosumes a web services. I used SoapExtensions to log the Request sent to server and Response received from server by adding a SoapExtension attribute to...
4
3233
by: =?Utf-8?B?TmFkYXYgUG9wcGxld2VsbA==?= | last post by:
Hi everybody, I've got two questions about using the EnableSession property with an ASP.NET WebService: First Question: I'm trying to create a web service with EnableSession=true. I can't...
5
1190
by: Kardon Coupé | last post by:
Dear All, I'm bemused, I'm moving an application I've written from VB6 into VS2005, and I'm getting all the fundamentals over before I delve into the hard part, like getting the forms layout...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
649
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.