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 / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Linking the same code to different versions of assembly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
carlos - 07 Mar 2008 14:06 GMT
I am creating a library that needs to be make in two versions. The
code is the same, but the
assembly that I reference has different implementations. How can I
create two separate versions of
this library using the same code? My current solution is to have the
same code in two separate
projects, each linked to the version of the assembly that I use.

This is a poor solution, of course. Do you have any suggestions to
improve this?

Thanks,
-Carlos Oliveira
Jon Skeet [C# MVP] - 07 Mar 2008 14:23 GMT
> I am creating a library that needs to be make in two versions. The
> code is the same, but the
[quoted text clipped - 6 lines]
> This is a poor solution, of course. Do you have any suggestions to
> improve this?

With a bit of hand-crafting of project files, you can have different
references for different configurations.

If you download MiscUtil, have a look at the project files for that -
you can build it in a .NET 2.0 configuration (which doesn't include the
3.5 assemblies) or a .NET 3.5 configuration (which does, obviously).

http://pobox.com/~skeet/csharp/miscutil

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Arne Vajhøj - 08 Mar 2008 03:49 GMT
> I am creating a library that needs to be make in two versions. The
> code is the same, but the
[quoted text clipped - 6 lines]
> This is a poor solution, of course. Do you have any suggestions to
> improve this?

I don't think that is different from any other plugin style
solution.

Your main stuff has an interface. Some DLL's each has a
class that implement that interface. Based on configuration
or user interaction that app loads a specific DLL and
create an instance of the class implementing the
interface.

You can code it yourself i relative few lines or
use a framework like Spring.NET.

Arne

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.