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 / Visual Studio.NET / IDE / October 2006

Tip: Looking for answers? Try searching our database.

No Support for Conditional References

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
martin.douglas@gmail.com - 22 Oct 2006 01:48 GMT
I am looking to be able to use the Visual Studio 2005 IDE to manage ALL
of my configurations.  It is easy to create custom configurations
throught he configuration manager and then to write code that is
sensitive to the active configuation.  That is easy except when it
comes to references.

What if I have some code that is not included under the current
configuration?  In my case, it is excluded through #if statements.  So
the source is gone, but I am forced to carry heavy payloads in the
final output directory due to the fact that I cannot exclude DLL's no
longer applicable in the references section of the project.

Why is there no simple support for this?  For example... why can't the
properties of a referenced assembly simply contain a list of the
configurations to which they apply?  A simple default value of "Applies
to all configurations" would make sense.

So not wanting to write build scripts, the only thing I have at my
disposal is to ask developers to remove the reference before compiling
under a given configuration and then remember to put them back when
they are done.  This is extremely sloppy.

Does anyone know of any other built-in functionality in the IDE?

Thanks in advance.
Carlos J. Quintero [VB MVP] - 23 Oct 2006 13:04 GMT
Hi,

There is no built-in support for configuration-based references, surely
because all configurations normally need the same references.

You could automate adding/removing references using a macro or add-in. Let
us know if you want to follow that route.

If you are only worried about the DLLs copied to the output folder, they can
be removed with a post-build action or macro.

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

>I am looking to be able to use the Visual Studio 2005 IDE to manage ALL
> of my configurations.  It is easy to create custom configurations
[quoted text clipped - 21 lines]
>
> Thanks in advance.
martin.douglas@gmail.com - 25 Oct 2006 04:16 GMT
A macro approach would suffice.  I need to get the entries out of the
project file in essence so that ClickOnce will not detect the DLL's as
dependencies and try to deploy them.

Thanks
Carlos J. Quintero [VB MVP] - 25 Oct 2006 12:15 GMT
See my article:

HOWTO: Getting information specific to VB.NET and C# projects from an add-in
or macro.
http://www.mztools.com/resources_vsnet_addins.htm

to learn how to access programatically the references of a project. You can
remove a reference with Reference.Remove and add them later with
References.AddXXX(...).

Signature

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com

>A macro approach would suffice.  I need to get the entries out of the
> project file in essence so that ClickOnce will not detect the DLL's as
> dependencies and try to deploy them.
>
> Thanks

Rate this thread:







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.