C# Debugger for ASP.NET Project gives different results than using dotnet run
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
Research direction
Reproduce the reported differences in an ASP.NET project using the VS Code debugger and dotnet run. Start by comparing launch.json and launchsettings.json, then inspect Program.cs, the .resx resources, and scaffolded Razor views. Done means identifying and documenting a reproducible cause for the missing resources and view overrides, or confirming the debugger and terminal behavior are equivalent.
Written by the indexing model from the issue text.
Description
Created several C# ASP.NET projects and tried using the C# and C# Dev Kit Extensions' Debugger. In most cases, it works as expected but additional issues keep piling up and could not find any solutions.
Eventually, I discovered that running dotnet run from the terminal resolved these issues, but could not find out why.
PROBLEM - Using the C# VS Code Debugger vs dotnet run has different results
- Pages cannot be found by the Debugger unless using the RazorRuntimeCompilation NuGet package and adding it in program.cs
- Translations through .resx files are not applied when using the debugger.
- View overrides through scaffolding are not applied, and reverts to a default.
ISSUE 1 - Loading .resx files
One MVC project uses .resx files for localization. Running this project with dotnet run has the page display in the correct languages.
When using the Debugger, it only shows English. In code, I've tried to print a list in the console of all keys, but it throws a MissingManifestResourceException when using the debugger, which seems to indicate that it cannot find the resx files.
ISSUE 2 - View Override
A different MVC Project is set up with the Security template option to create local accounts. I've scaffolded the default Register page to also allow users to input additional information like First Name, Middle Name, Last Name, etc.
Using dotnet run, navigating to the page to Register shows the additional fields I've added.
Using the Debugger, it just shows the standard Register page without my changes. For some reason, the debugger does not find my changed files. First image is the page using the Debugger, second one is using dotnet run
Things I've tried
- Ensured that launch.json and launchsettings.json match. They do.
- Toggle AddRazorRuntimeCompilation() in program.cs to see if it makes any difference. Without it, using the debugger doesn't work as it cannot find ANY file at all.
- Asked on Stack Overflow. No replies.
Most of my findings point towards the Flatpak being sandboxed and VS Code's Debugger being unable to find the correct files. But the debugger and dotnet commands have the same permissions so not sure why it could cause a difference.
- Dominant language
- Shell
- Stars
- 216
- Forks
- 82
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from flathub/com.visualstudio.code
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
flathub/com.visualstudio.code#679 · 4 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
flathub/com.visualstudio.code#563 · 2 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
flathub/com.visualstudio.code#388 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
flathub/com.visualstudio.code#715 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
flathub/com.visualstudio.code#710 ·
All issues in flathub/com.visualstudio.code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
technical-debt
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
ll7/robot_sf_ll7#9560 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100