C# Debugger for ASP.NET Project gives different results than using dotnet run
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
Direzione di ricerca
Riproducete le differenze segnalate in un progetto ASP.NET usando il debugger di VS Code e dotnet run. Iniziate confrontando launch.json e launchsettings.json, quindi esaminate Program.cs, le risorse .resx e le viste Razor generate. Il lavoro è completo quando avete identificato e documentato una causa riproducibile per le risorse mancanti e le sovrascritture delle viste, oppure confermato che il comportamento del debugger e del terminale è equivalente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Shell
- Stelle
- 217
- Fork
- 81
- Merge medio
- 4g 12h
- PR unite (30g)
- 3
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di flathub/com.visualstudio.code
-
Document podman/dockerAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
flathub/com.visualstudio.code#679 · 4 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
flathub/com.visualstudio.code#563 · 2 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
flathub/com.visualstudio.code#388 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
flathub/com.visualstudio.code#715 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
flathub/com.visualstudio.code#710 ·
Tutte le issue di flathub/com.visualstudio.code
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
adobe-fonts/source-serif#152 ·
-
area:ansible source:reader type:content-error
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
stephrobert/blog-roadmap#42 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nolabs-ai/nono-packs#44 ·
I maintainer di solito rispondono entro 1 giorno