Custom content files for MVC vs. Web Forms?

Dec 23, 2010 at 5:38 PM

I am building a NuGet for a library that targets client apps, ASP.NET web forms, and ASP.NET MVC.  Obviously the content files to inject into each of these projects will be different.  How can my NuGet apply appropriate to each one?

One approach I thought of is to have multiple NuGets, one for each scenario, and each of these taking a dependency on a core NuGet that actually includes the library reference itself.

Is this the best approach?  Or can I have a single NuGet that does the right thing for any environment?

Dec 23, 2010 at 6:48 PM

Your on the right track with making the seperate packages. By doing that you can minimize install scripting. I have found that making smaller targeted packages has helped simplify things for me in our corporate usage of nuget at Dell. Trying to do branching inside of a install powershell script complicates your package maintance and then you have to implement the uninstall yourself too. By keeping to the smaller packages you get to let nuget do all the install and uninstall work.

sent from my mobile

Dec 23, 2010 at 8:51 PM

Agreed, the multi package approach is the way to go.  Name the package with a clear suffix like "BaseName.Mvc" or "BaseName.WebForms".