1

I'm using Visual Studio 2019 to code my two separate projects placed in main solution. First part is just a Client-side code that will be compilated in a client's machine (Not in Visual Studio, it's only raw code that will be copied to other folder after Build). And second part is a server-side code that have to be complited when I press Debug button.

I want the following: when I press F5 (To run my code), first project should be built like as I choose it and press ctrl+b and in this time second project should be debugged (compiled and opened).

Client-side project (first project) is just a couple of files that I need to copy to different folder without any compilation and VS's stuff, here's post-build event command line:

del "path_to_work*.*" /Q
for /R %CD% %%i in (*.cs) do (xcopy %%i "path_to_work" /Q /Y /EXCLUDE:exclude.txt)

To clear situation, I'm bored with switching among projects and need to do two actions in one click (Build & Debug).

I apologize for my terrible English.

  • 1
    Possible duplicate of [Running two projects at once in Visual Studio](https://stackoverflow.com/questions/3850019/running-two-projects-at-once-in-visual-studio) – R2RT May 12 '19 at 08:42
  • Projects can be built automatically on run, and this can be *all* projects (not just dependencies of the projects being run). Tools | Options | Projects and Solutions | Build and Run. – Richard May 12 '19 at 08:44

1 Answers1

2

Visual Studio support builds and runs multiple projects at the same time, but it requires a sequence.

In short, you can always use right-click project> Debug> Start new instance to run any project at any time.

Eg: right click run backend project then right click again run client project, both instances run simultaneously.

Apologize if this solution not so automated solution, but it simple and work like charm.

Kira Hao
  • 1,077
  • 11
  • 17
  • I want to clarify: I need to build one project and run (debug) other in one action. Now I can do this in some more actions, but I'm bored to do it often so I want more comfortable way to do this with less clicks. – Vynder Style May 13 '19 at 14:49