2

I have been having issues with my Visual Studio 2015 for quite a while now. I am working in C# and MonoGame. For my game I am running 3 separate instances of a MonoGame launcher. However when I stop debugging my game in visual studio it is often the case that at least one of my MonoGame instances hangs around suspended in the background. This then doesnt let me start debugging my game until I go into task manager and manually kill the process running. This has been slowing down my development process for some time now.

Image taken when i try to start debugging, while a process is running in the background.

Suspended MonoLauncher instance.

I was hoping to get some information on why this may be happening, and hopefully find a fix for this. Any help would be appreciated. Cheers.

Branden
  • 347
  • 1
  • 14
  • Hello, what version of Monogame do you have? I had this issue, and another one where I couldn't debug if my game was in fullscreen. But first to be sure, I need you to show me the code of your Game.cs and a picture of what it looks like with the 3 instances. Cheers. – Javier Silva Ortíz Nov 02 '19 at 02:53

1 Answers1

1

Try Running Visual Studio as Administrator. Still this is possible when you stop the debugging at the middle of some functionality.

If you don't want to kill it manually. One possible option/hack is running a batch file on program closing.

if (Debugger.IsAttached)
{
     System.Diagnostics.Process.Start(@"C:\KillMonoLauncher.bat");
}

In KillMonoLauncher.bat file

taskkill /f /im MonoLauncher.exe
CharithJ
  • 46,289
  • 20
  • 116
  • 131