Reputation: 31
I’ve set up an ASP.NET 4.0 web application using Visual Studio 2022 and deployed it on Linux (WSL Ubuntu 22.04). I’m using Mono and VSCode for debugging. Here are the steps I’ve followed:
Created the web app.
Installed mono-complete, mono-xsp4, and nginx.
Deployed the app to /var/www/XXX.
Updated the Nginx configuration.
Installed VSCode and opened the project in VSCode.
Ran the command: MONO_MANAGED_WATCHER="y" MONO_OPTIONS="--debug --debugger-agent=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:55555" xsp4 --address 0.0.0.0 --port 9000 --verbose --root Content/.
Added launch settings in VSCode for attaching to Mono and debugging my app.
{
"name": "Attach to Mono",
"request": "attach",
"type": "mono",
"address": "localhost",
"port": 9000,
},
{
"name": "Debug My Mono App",
"request": "launch",
"type": "mono",
"program": "/var/www/XXX/"
},
Opened the app in the browser at http://localhost:9000/Default.aspx.
The debugger toolbar appears, but breakpoints are not hit.
What am I missing? How can I successfully attach breakpoints? We’re exploring the possibility of migrating our existing ASP.NET app to Mono instead of .NET Core.
I tried with monodevelop as well but there also i am not able to attach the breakpoint
Upvotes: 0
Views: 231
Reputation: 31
I found out the root cause of this issue. The debugger port that is provided in the launch.json is wrong it should be 55555 as shown below.
{ "name": "Attach", "type": "mono", "request": "attach", "address": "localhost", "port": 55555 },
Upvotes: 0