2
votes

I have an ASP.net MVC application hosted on pivotal cloud foundry. As a space developer, I have access to Apps Manager tile, and the cf CLI. Is it possible to attach a remote debugger to my application running in the windows container?

I have found that it is possible for a linux stack on cloud foundry, but so far no luck getting any such resources for .NET.

No dev guides on pivotal have this usecase. Are all .net applications debugged by checking the logs (acknowledge that .net apps are not pushed to pcf that often)?

Any help is appreciated thanks.

2

2 Answers

2
votes

There isn't any official documentation yet, but the piece that was missing was SSH support, which is now included with PASW2016.

The Garden Windows team has been able to debug applications on Windows Server 2016 with these steps:

  • Publish project with Debug any-cpu
  • Download the version of Remote tools that matches your Visual Studio version: https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugging
    • Copy the contents of the folder you get from that installer (C:\Program Files\Microsoft Visual Studio 15.0\Remote Tools\DiagnosticsHub for my 2017 install) into your app's publish directory
  • cf push the publish folder with included debugger tools
  • cf ssh app -L 4022:localhost:4022
  • Start the msvsmon.exe from the app dir with the following arguments: .\msvsmon /noauth /anyuser /port 4022 /silent /nosecuritywarn
  • in VS go to Debug>Attach to process
    • Select Remote (no authentication)
    • Qualifier: localhost:4022
    • Make sure attach to is set to Managed (v4.6, v4.5...)
    • select hwc.exe
    • Set a debug point and make requests to your app

This info is from https://www.pivotaltracker.com/n/projects/1156164/stories/152283658 I have not had a chance to personally test it out yet

0
votes

It is possible, for testing purpose you can add a code for generating text file in your that code where you want have debugging. Create file there and append all code results line by line in that file. It will be created on your hosting server where you have website. Then you can open and verify results in that file.