Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent visual studio shutting down service fabric services

When I run my service fabric service in visual studio it deploys to the service fabric as expected. When I stop debugging in visual studio, visual studio then unprovisions the service fabric service.

Is there any way to prevent this behaviour? I would prefer it if visual studio left the service running in service fabric.

Thanks,

Slicc

like image 861
Slicc Avatar asked Jan 05 '23 21:01

Slicc


1 Answers

There are two ways this can be done:

  1. Launch your app from VS without the debugger attached (Debug -> Start Without Debugging [Ctrl+F5]). Obviously, this would require you to manually attach VS to your service processes in order to debug them. When you detach VS from the processes, VS will not remove the application in this scenario.
  2. With your Application (.sfproj) project selected in Solution Explorer, go to the Properties window and change Application Debug Mode from "Remove" to "Auto Upgrade". This prevents VS from removing the application after debugging. However, it also causes another change in behavior in that it will automatically upgrade your application each time you launch it from VS. The added benefit of auto upgrade is that your application state will be maintained across multiple launches from VS. This may be desired or not. There is not a setting that allows you to both prevent application removal and not do an auto upgrade.
like image 122
Matt Thalman Avatar answered Jan 17 '23 17:01

Matt Thalman