Link to home
Start Free TrialLog in
Avatar of andreas_rafn
andreas_rafnFlag for Denmark

asked on

Extending an existing project on basis of another project in the same solution in VS2010 and VB.NET

I have made a "base" application that implements the base functionality of the requirements for it. However next step is to create an "extended" version that supports external data through a thrid party application that need to be installed for the user in order to use it. Since not all users hold the prerequisites for the extended version, I would like to have a "base" and a "extended" version installed along with each other so that all users can use the system regardless of their setups through the "base", but use the features of the "extended" version if the have the third party application.

The extended version will be an exact copy of the base version with some code added. So I'm currently considering how I can do this the best way. Note that I have nearly no experience with deployment of big solutions with several projects.

Ideally the extended version merely references the base version and implements the extra functionalty on top. In that way changes made to the base version will be applied to the extended version too.

Is there a good way to do this?
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

You may want to look at Managed Extensibility Framework

http://msdn.microsoft.com/en-us/library/dd460648.aspx
I think you have 2 ways to do it:
1. The extended version has to inherits objects from base version and add extra functionalities.
In this solution the client needs to add reference to either base or extended version and use the specific objects and when it creates an object it should know if the object will be a base of extended object

2. Use the ExtensionAttrbute from System.Runtime.CompilerServices
This solution is only available for methods and functions and cannot be implemented for extending properties or events of an object. In this solution you'll create objects declared in the base library, but when you'll add the reference to the extended library you can use the methods and functions declared there for base objects

In order to give more detailed explaination I need to know which solutions do you think it best applies to your project
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andreas_rafn

ASKER

Great answer! Thanks.