Hi,
Let me know if I understand your question first.
You have a copy of Lean engine compiled in Visual Studio and you want to start a backtest in GUI mode displaying the data into the "Lean Backtest Desktop" window. Doing so, your Visual Studio restarts.
I use latest master branch in Visual Studio 2017 and 2019 and all is working fine.
The only difference is that I do not use any plugin as I like to kow at the low level what is happening.
Personally I would have a clean Visual Studio environment in which you compile Lean.
Then you just have to configure a few things:
1. In QuantConnect.Lean.Launcher project, modify config.json file as per below:
"environment": "backtesting-desktop"
"algorithm-type-name": "BasicTemplateFrameworkAlgorithm", //or whatever algo you have
"algorithm-language": "CSharp" //cSharp is as default as I use C#
"job-user-id": "xxxx",
"api-access-token": "yyyy",
xxxx and yyyy you find them into "My Account section as below"
"Your unique access token to the API is shown below:
yyyy
Your user id for the API is shown below:
xxxx"
2. Second Step is: Right Click on QuantConnect.Lean solution and select "Properties"
On this "Property Pages" window, select "Configuration" under "Configuration Properties".
This will list all projects and here make sure all projects have the same Configuration
either "Debug" either "Release".
As default in debug mode, all have "Debug" selected except project QuantConnect.Views
which has the "Release" configuration selected.
This will give you runtime exceptions if you try to start the application (QuantConnect.Lean.Launcher" is the default project to run by the way).
Once you made sure all projects have lets say Debug Configuration selected, click Apply and then OK.
Save all and recompile the solution.
If you do all these stepts correctly it will work and you shoulsee "Lean Backtest Desktop" window.

Cheers and Happy testing