I’m currently working on “suite” of internal intranet applications
They are all asp.net MVC apps, which will be (for various reasons) deployed as separate apps
I’m currently facing massive amounts of duplication -
Each app has essentially the same “outer” shell This outer shell isn’t just about views, it encompasses authentication logic etc…
The “inner” view is the actual app.
So, in an ideal world, I’d have something like:
MyCompany.Web
Holds the _Layout, base controllers, auth etc…
Then, other mvc projects in my solution such as:
MyCompany.Web.App1
inherits MyCompany.Web
MyCompany.Web.App2
inherits MyCompany.Web
etc…
Is there anything I could sensibly do to facilitate this?
Everything I’ve tried so far involves xcopying views etc.. into sub projects on builds, and feels very fragile.
Create nuget packages for all assembly based code to be shared.
Consider whether nuget packages make sense for any view or layout file sharing.
Consider making a project template that includes usages of the relevant nuget packages. This will allow you to follow the same pattern MVC itself is taking that you can create a new project and update nuget packages as necessary. This eliminates the need for frequent changes to the template itself, except where changes aren't readily shared by nuget.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With