Using the C# Debugger shows different Views than when using dotnet run
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
調査の方向性
まず、デフォルトの .vscode/launch.json デバッガー構成とターミナルの dotnet run 経路を比較し、次にデバッガーが program.cs、Register.cshtml、Register.cshtml.cs、および関連するビューと .resx ファイルをどのように処理するかを調べます。デバッガーと dotnet run が同じスキャフォールディング済みのビュー、フィールド、ローカライズされた値を読み込めば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 3.1k
- フォーク
- 740
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 52
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/vscode-csharp のほかの issue
-
Remove temporary .NET 11 CI container digest pin再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンInfrastructure Test
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
dotnet/vscode-csharp#9791 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
C#DK untriaged
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
dotnet/vscode-csharp#9911 ·
メンテナーはふだん 1 日以内に返信
-
reporteオープンC#DK untriaged
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
dotnet/vscode-csharp#9910 ·
メンテナーはふだん 1 日以内に返信
-
aオープンC#DK untriaged
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
dotnet/vscode-csharp#9901 ·
メンテナーはふだん 1 日以内に返信
-
Debugger untriaged
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
dotnet/vscode-csharp#9891 · コメント 6 件 ·
メンテナーはふだん 1 日以内に返信
dotnet/vscode-csharp の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
outline/outline#14348 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: Agent import retains quotes in .env API keys followed by inline comments対応中かも @yxr-2025 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
elie222/rakazo#2322 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
awslabs/visual-asset-management-system#804 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
dsh-market/dsh-market#1027 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信