Search code examples
c#.netazure-service-fabric

Service Fabric Debugging


When I try to run SF service from VS in debug mode I get the following:

An attempt was made to upgrade the application but the application's version has not been changed. Be sure to update the version in the application manifest prior to upgrading.

Where I have to manually delete this service in SF explorer. Is there a way to skip this removing step somehow so that the service that is being debugged simply 'overwrites' old one?


Solution

  • It happens because the configuration for Application Debug Mode is not set correctly. The setting is probably set to keep the application in Service Fabric when you stop debugging, this way, after the first deployment, the application will stay running the old code deployed to SF.

    Your other option is set it to either Remove Application or Refresh Application

    For reference, your options are:

    Application Debug Modes

    • Refresh Application This mode enables you to quickly change and debug your code and supports editing static web files while debugging. This mode only works if your local development cluster is in 1-Node mode. This is the default Application Debug Mode.
    • Remove Application causes the application to be removed when the debug session ends.
    • Auto Upgrade The application continues to run when the debug session ends. The next debug session will treat the deployment as an upgrade. The upgrade process preserves any data that you entered in a previous debug session.
    • Keep Application The application keeps running in the cluster when the debug session ends. At the beginning of the next debug session, the application will be removed.

    This doc explains with more details.