Developing and debugging projects in mutli-repository in Visual Studio

Viewed 402

This is the basics of the problem I am having (of course it is oversimplified for the sake of the question): I have 2 projects in a solution stored in mono-repository:

  • Project1 - outputs a library
  • Project2 - outputs an executable

When Project2 references Project1.

I would like to move to multi-repository where Project1 will be stored in different Repository from Project2. Project1 will output a nuget package and Project2 will reference it instead the project itself.

The issue I am facing: in current situation (mono-repository) when during development I introduce a feature in Project2 that also requires a change in Project1 it is not a problem. If there are problems I can discover it during development time.

In a new way (multi-repository) I first need to make a change to Project1, create nuget and push it to nuget store, then update reference in Project2. If I would have problems in Project1, I must go back to Project1, fix the issue and push it again, update reference in Project2 and so on. Also, losing the benefit of debugging both projects.

Is there a solution to this approach? To focus my question: if I have source codes of both projects on my dev machine, is it possible somehow to instruct Visual Studio to use source code instead of referenced Nuget for debugging?

Hope I explained it right and clear as possible...

1 Answers

If you have two different projects and both of them are in different repositories, you could add the library as a submodule of the first project. I'm assuming you're using git. You could do this simply by:

    git submodule add <link for the other repo>

In visual studio you just add the project to the same solution and then reference library from the executable. I'm not sure if that would do the trick for you, but I hope that works.

Related