1

This is a little bizarre but I really hope someone can help.

My client has two Asp.Net MVC websites, SiteA and SiteB. Site B is essentially a subset of the functionality in Site A and has a separate team developing it. In essence when a developer working on Site B needs to run the website he first needs to publish site A, and then publish site B over the top.

This can all be done with manual publishes through visual studio but is far too cumbersome and long winded given the volume of code changes at my client. Besides which developers working on SiteA are not able to access the code in SiteB, nor do they care about it.

I've found this post which notes how to achieve a publish of SiteA and Site B as part of a Publish.proj file.

http://sedodream.com/2013/09/21/HowToExtendTheWebPublishProcessWithoutModifyingProjectContents.aspx

Essentially I want to achieve the same effect in Visual Studio when I build the sln which contains site B, with the caveat that developers on SiteA (different sln - see below) don't require a publish, but developers on SiteB do require a publish.

Worth noting that we have two .sln files depending on which team your in. If you develop on SiteA, then you see a sln file which doesn't have any references to SiteB. And if you develop on SiteB there's a sln which has both SiteA and SiteB in. Both sln files reference SiteA from the same path, and therefore changes to the proj file for siteA affect both teams.

I doubt this make sense. It would be great if on compile of site B I could trigger a compile and publish of SiteA, then a publish of SiteB.

Are there any MSBuild tasks that I can use in the csproj file of SiteB to trigger a build an publish of SiteA first?

Any thoughts help would be great.

Tim

Tim Butterfield
  • 565
  • 5
  • 24
  • Are you talking about build on continuous integration server, or local build from visual studio? I don't think it is an issue for automated process, so looks like you're talking about local build. Do you want that site A will be published with *every* build of sln by TeamB? Sounds like crazy long story. Maybe you need to tweak process and separate teams and codebases, so that Team A delivers theirs code drop once a week (ok, once a day), so that publishing of site A wont'b be part of every build for TeamB? – Lanorkin Mar 20 '14 at 11:51
  • Crazy is a good word for it. Yes, applies to local not CI or Deployment. Thanks for the suggestion about separating code bases. The client currently has two branches of the same code bases in TFS which is causing significant and frequent merge pain. You were right though, that SiteA should be published with every build by Team B who use a different sln file. Essentially I'd like a pre build task that publishes site A (which I can do, but it involves a second build of site A which already builds as a dependency). Ahhh, Sigh. – Tim Butterfield Mar 20 '14 at 13:55
  • Do you really need a publish then? For local env you can just map siteA in IIS to the web project folder where actual site is located, so during each solution build it will be just rebuilt in place. If there are several web sites which are merged into one or something like that - you can try creating virtual folders in IIS. So basically idea is to configure local environments so that siteA is always built whenever you building siteB, without publish step at all - is it possible? – Lanorkin Mar 20 '14 at 14:05
  • Thanks for the suggestion. Not sure it fits, but thanks for the idea. I think this might help http://stackoverflow.com/questions/5268177/is-there-anyway-to-define-constant-on-a-solution-basis – Tim Butterfield Mar 20 '14 at 14:27
  • Thanks for the suggestion. Not sure it fits, but thanks for the idea. I think this might help http://stackoverflow.com/questions/5268177/is-there-anyway-to-define-constant-on-a-solution-basis as I can see solution wide settings. Might be able to publish relative to each solution settings (although might be a problem from MSBuild Command line.). Thanks – Tim Butterfield Mar 20 '14 at 14:58

0 Answers0