vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Breakpoint not hitting when debugging .NET Framework 4.8 on VS Code - Web App - Local IIS

Open davesunny1985 opened this issue 5 months ago • 3 comments

hi team,

I have been trying to debug .NET Framework 4.8 Web Application on Visual Studio Code however, the breakpoint is not hitting on local IIS. I tried different things already like restarting and updating VS Code, restarting IIS, recycling app pool. I have launch and task json files and I am using clr and w3wp process to achieve that

Please help!

Thanks

davesunny1985 avatar Aug 18 '25 00:08 davesunny1985

The support for .NET Framework in the C# extension is limited. See https://github.com/dotnet/vscode-csharp/wiki/Desktop-.NET-Framework for more information.

gregg-miskelly avatar Aug 18 '25 18:08 gregg-miskelly

Thanks @gregg-miskelly for the reply however, I could see the above information is more of a Desktop debugging on .NET Framework. I, as mentioned, am using .NET Framework 4.8 Web App on local IIS. To give more info on that, I am able to attach the process (w3wp) however, it doesn't hit the breakpoint and that's the issue I want to resolve

To add to your comments, my web app is specified as 'AnyCPU' and not specific to 'x64'

Hope it helps understand the specific issue I am having with VS Code

Please suggest

Thanks again

davesunny1985 avatar Aug 19 '25 00:08 davesunny1985

@davesunny1985 let me try and walk you through the information in that wiki page a bit. First, the reason I am guessing this is failing is because you are NOT using portable PDBs. Portable PDBs are not the default for .NET Framework scenarios, and I am not certain if they are even supported for all .NET Framework scenarios. If you know what module contains the code you are trying to debug, you can look in the Debug Console, find the line indicating your module loaded, and see if you are getting a warning about a Windows PDB.

my web app is specified as 'AnyCPU' and not specific to 'x64'

Since the attach is succeeding, this probably isn't your problem. But, to clarify in case you attached to the wrong process -- it doesn't matter if your code is compiled as AnyCPU, as there is no such thing as an "AnyCPU" process. Eventually your code needs to run in an x86, x64, or ARM64 process. To work with this extension, it can't run in an x86 process.

I should probably also add -- full Visual Studio is the recommended tool for .NET Framework projects, which is not to say that they can't work in VS Code, but you will be off the golden path. So, everything will be a bit of work at the least, and some things just will not work at all.

gregg-miskelly avatar Aug 19 '25 00:08 gregg-miskelly