We have inherited an application that is made up of small .NET web API's. Each API has its own Visual Studio SLN and git repo. All of the APIs are published to one folder ("All") and that folder is hosted on IIS with each of the APIs as a separate application on the same website and app pool. The folder with the published APIs also has a git repo.

The one exception is the 'CommonOps', which is a class library that all other APIs share. The dll is published into a common folder.

Everything works for the most part, and I don't want to create unnecessary work (or update for update's sake).

The problem is when we find a bug. For instance, if something in the CommonOps needs updating, we need to create a branch in both, the CommonOps and the "All" repo. Then publish the updated CommonOps (pull request and merge), to "All" and then pull request and merge "All". If other people work on "All" at the same time, pull requests can lead to marathon merge conflicts.

What would be the best approach to unifying the whole lot into one repo, or should I leave well enough alone? If the latter, what would work best for a workflow when we need to change one of the APIs?


OK, this is the 'correct' way to manage your APIs

  • Delete the All repo

  • Publish the CommonOps library as a nuget package

  • Consume CommponOps nuget in the various APIs

  • Publish each API in its own website rather than Applications under a single WebSite

When you update CommonOps, publish a new version of the package, feature branch those APIs requiring the new version, update the package, merge, build and deploy those APIs

| improve this answer | |
  • That sounds great, but it would mean that every API (every website) would need to be bound to a different port. Or is there a way around that? – 4ndy Jul 25 '18 at 11:45
  • yes, host headers. they have been around a while – Ewan Jul 25 '18 at 11:46
  • or multiple ips per box if you like – Ewan Jul 25 '18 at 11:47
  • 1
    or do the ports, but hide them behind your load balancer – Ewan Jul 25 '18 at 11:48
  • 1
    or use docker and you can do all of the above in a few configuration files – Edoardo Jul 26 '18 at 5:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.