Click here to Skip to main content
15,903,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to build multiple mvc web applications. I have some framework components which can be re-used in those applications. Even I have a framework for the UI, which can render the UI dynamically. Is there a way to make this web project as a shared one and their reference can be added to different applications so that they will also have the support for those framework components out of the box ?
Posted

Create your MVC project as normal then add your shared project as a class library to the same solution and add a Project Reference to the shared project from your MVC project. For other sites add the same shared library to those solutions also. That way if you need to make changes to the shared library you can make them right away, and every time you open a different solution you'll automatically get the latest version of the shared project too. Obviously you have to be wary of breaking changes though, ie changes to the shared library that might break other projects. As this method will give you different versions of the dll with the project you're only sharing the source code really, each project will have its own copy of the assembly. To actually share the assembly itself you'll need to use the GAC but that'll be more hassle than is worth and gives you a far greater risk of updates breaking other projects.
 
Share this answer
 
v2
Compile it as DLL and simply include it in project references wherever you need it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900