2

I asked a "similar" question here:

Visual Studio Multi-Project Solution Options

However, that did not specifically address my problem. In short: what is the best way to share a master page across a multi-project solution? I have a solution with over 20 internal Web app projects and want a common master page for all of these.

UPDATE:

I will need to share other resources also - CSS, images, JS files, etc.

Community
  • 1
  • 1
IrishChieftain
  • 15,108
  • 7
  • 50
  • 91
  • I put one alternative as an answer, but I would favor the accepted answer from your previous question. Linked files seems like the best option. – Ken Pespisa Jun 07 '11 at 15:58
  • That would still mean hand-copying every shared file when deploying? – IrishChieftain Jun 07 '11 at 16:14
  • Oh right, I see. Yes, that hand-copying aspect would be miserable. – Ken Pespisa Jun 07 '11 at 16:38
  • Liking your Nuget suggestion below... any info/comparison between that and project templates welcome :) – IrishChieftain Jun 07 '11 at 16:40
  • 1
    @Irish, The first one that comes to mind is that if you make changes to your project templates, you can't easily apply those changes to existing projects, whereas with NuGet you'd be able to use the upgrade package feature to get the latest files. Also, you can apply a NuGet package to an existing project that doesn't yet have the resources. Otherwise, the idea is similar - the actual resources are put directly into your project where you specify, eliminating the need to worry when you publish the site. – Ken Pespisa Jun 07 '11 at 16:44
  • Sounds like a winner! :) – IrishChieftain Jun 07 '11 at 16:54

1 Answers1

1

Perhaps you could take advantage of NuGet? You could create a custom package, and host it internally. For each project you'll just need to install the package, which would bring in all the CSS, images, JS files, and masterpages.

When you make changes to the nuget package, you could easily "upgrade" the package using the package manager dialog in your project

Ken Pespisa
  • 21,989
  • 3
  • 55
  • 63
  • This sounds really interesting... any good "start up" links? :) And how do you think this would compare to using some kind or VS project template? – IrishChieftain Jun 07 '11 at 16:15
  • @Irish, Scott Hanselman has [a post](http://www.hanselman.com/blog/CreatingANuGetPackageIn7EasyStepsPlusUsingNuGetToIntegrateASPNETMVC3IntoExistingWebFormsApplications.aspx) on this. Also there's a [video from MIX](http://channel9.msdn.com/Events/MIX/MIX11/FRM09) on creating / consuming packages – Ken Pespisa Jun 07 '11 at 16:41