Service Fabric part.2— How to attach Visual studio code to the ASP .NET core process in the Service Fabric cluster?

Jen-Hsuan Hsieh (Sean)
A Layman
Published in
4 min readMar 6, 2019

--

Copy right@A Layman

Introduction

Attaching Visual studio code to the process for debugging is easy. However, There are some differences between an ASP .NET process and an ASP .NET core process deployed to the local Fabric cluster when you attach.

  • You can’t find process ID from appcmd when you want to attach the process because the process is independent of IIS.
  • You can’t start debugging from Visual studio if other services depend on the service behind the local Service Fabric.

Finally, I found out the solution after I tried many ways. The following steps are my thoughts.

1. Attach the process from Visual Studio — Failed

  • The first step is getting the process ID from the following PowerShell scripts:
Connect-ServiceFabricCluster
Copy right@A Layman
Get-ServiceFabricApplicationGet-ServiceFabricDeployedReplica -NodeName "_Node_0" -ApplicationName "{name}"

--

--

Jen-Hsuan Hsieh (Sean)
A Layman

Frontend Developer🚀 Angular • React • Nest • Electron • Micro-frontend • Monorepo Architecture • https://daily-learning.herokuapp.com/