Prevent visual studio shutting down service fabric services

China☆狼群 提交于 2019-12-01 19:25:54

问题


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


回答1:


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.


来源:https://stackoverflow.com/questions/37921434/prevent-visual-studio-shutting-down-service-fabric-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!