Using the C# Debugger shows different Views than when using dotnet run
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza comparando la configuración predeterminada del depurador en .vscode/launch.json con la ruta de terminal dotnet run; después, inspecciona cómo el depurador gestiona program.cs, Register.cshtml, Register.cshtml.cs y las vistas y archivos .resx relacionados. La tarea estará terminada cuando el depurador y dotnet run carguen las mismas vistas generadas por el scaffolding, campos y valores localizados.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment data
.NET SDK:
Version: 10.0.300
Commit: caa81fa497
Workload version: 10.0.300-manifests.b47d7e23
MSBuild version: 18.6.3+caa81fa49
Runtime Environment:
OS Name: org.freedesktop.platform
OS Version: 25.08
OS Platform: Linux
RID: linux-x64
Base Path: /usr/lib/sdk/dotnet10/lib/sdk/10.0.300/
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
Host:
Version: 10.0.8
Architecture: x64
Commit: 94ea82652c
.NET SDKs installed:
10.0.300 [/usr/lib/sdk/dotnet10/lib/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 10.0.8 [/usr/lib/sdk/dotnet10/lib/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 10.0.8 [/usr/lib/sdk/dotnet10/lib/shared/Microsoft.NETCore.App]
Steps to reproduce
- Project Setup
- Create a new MVC Project with Authentication enabled. Choose Individual Accounts for type.
- Scaffold the Register.cshtml page for a custom User class that inherits from IdentityUser by using the steps described in the official documentation for scaffolding Account pages.
- Make sure this User class has additional fields like First Name and Last Name
- Open the Register.cshtml page and add the additional fields for First Name and Last Name
- Open Register.cshtml.cs and expand Input to include the new fields.
- Set the First Name and Last Name fields in the custom User class in OnPostAsync in Register.cshtml.cs
- Debugger Setup
- Create the launch.json file in .vscode
- Use the default .NET Core Launch (Web) setup
- Change the "program" path to the .dll file.
Debugging
- Debug the program, the View Index cannot be found.
- Stop the Debugger and update program.cs by adding RazorRuntimeCompilation to the Services (needs NuGet Package)
- Debug the Program again. Views work now. Navigate to the Register page.
- The View is still the standard Register View and not the scaffolded version with the additional fields.
- Stop the debugger and open the terminal. Type
dotnet runand press enter - Navigate to the Register page and notice it now displays the correct View with the fields for First Name and Last Name.
Expected behavior
- Using both
dotnet runand the Debugger should show the same results in Views
Actual behavior
- Running the app with the Debugger shows different Views. The first image is using the Debugger. The second is when using
dotnet run
Additional context
- Similar issues occur when trying to use .resx files for translations. Using a ViewLocalizer in a Razor page will only display the Values when using
dotnet run. With the debugger, it simply displays the Keys as the .resx files appear to not be loaded / compiled when using the debugger. - This version of VS Code runs in a container, but it has full access to all files outside the container and the problem persists.
- Lenguaje dominante
- TypeScript
- Estrellas
- 3.1k
- Forks
- 741
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 59
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotnet/vscode-csharp
-
Remove temporary .NET 11 CI container digest pinQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. AbiertoInfrastructure Test
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
dotnet/vscode-csharp#9791 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
C# extension crach in VS CodeAbiertountriaged
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
dotnet/vscode-csharp#9940 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Bug C#DK
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
dotnet/vscode-csharp#9910 ·
Los mantenedores suelen responder en 1 día
-
aAbiertoC#DK untriaged
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
dotnet/vscode-csharp#9901 ·
Los mantenedores suelen responder en 1 día
-
Debugger untriaged
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
dotnet/vscode-csharp#9891 · 9 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de dotnet/vscode-csharp
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Northeastern-Electric-Racing/FinishLine#4660 ·
Los mantenedores suelen responder en 2 días
-
BeOS .json missingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mihaip/infinite-mac#475 ·
-
Let TypeScript accept an initial object in ReactiveDictPosiblemente ocupada @yograj-vijay-yadav la tomó hoy. Abiertobug good first issue help wanted workshop
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
meteor/meteor#14919 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
marmelab/atomic-crm#401 ·
Los mantenedores suelen responder en 1 día
-
account: profile
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 5 días