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
There are two ways this can be done:
- 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.
- 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.