To debug a .NET Core application running on Linux

Note: If you want to debug a COBOL application running under .NET Core on Linux the application must have a portable .pdb file. To produce a portable .pdb file for an application you need to specify either Portable or Embedded for Debugging information on the Advanced COBOL Settings dialog box before building the application. See COBOL Properties for more information on the different values you can specify for the Debugging information option.

To debug a .NET Core application that is running on Linux you use Visual Studio's Attach to Process option:

  1. Click Debug > Attach to Process.

    The Attach to Process dialog box is displayed.

  2. In the Connection type field, select SSH.
  3. In the Connection target field, type the name of the Linux machine to connect to, then press Enter.

    The Connect to Remote System dialog box is displayed.

  4. Enter the connection details for the Linux machine to connect to, then click Connect.

    The Available processes list displays the processes running on the Linux machine that you can attach to.

  5. Click Select.

    The Select Code Type dialog box is displayed.

  6. Click Debug these code types, check Managed (.NET Core for Unix), then click OK to specify the type of code that you want to debug.
  7. Select your .NET Core process from the Available processes list, then click Attach. If you deployed using framework-dependent deployment (FDD), your application's process name will start with dotnet. If you deployed using self-contained deployment (SCD), the process name will be the name of your application.

    Visual Studio connects to your .NET Core application and you can start debugging as normal.