Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`DebuggerTypeProxy` generates an invalid expression when runtime and static types differ

Aperta
#9,108 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
csharp, typescript, vscode
Ambito
devtools

Direzione di ricerca

Esegui la riproduzione C# fornita in VS Code e ispeziona i percorsi del debugger utilizzati da Copy Value e Copy as Expression per un DebuggerTypeProxy i cui tipi runtime e statico differiscono. Il lavoro è completato quando Copy Value restituisce Value e Copy as Expression include il cast Derived richiesto nell’espressione DebugProxy generata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Debugger Debugger-ExpressionEvaluation

Type: Bug

Issue Description

When expression runtime type is different from its static type, and runtime type define DebuggerTypeProxy, then that proxy displayed in Locals view, but interacting with proxies' properties (Copy Value, Copy as Expression) produce incorrect result.

Steps to Reproduce

using System.Diagnostics;

namespace Test;

public static class Program
{
	public static void Main()
	{
		Base v = new Derived();
	} // breakpoint here
}

public class Base { }

[DebuggerTypeProxy(typeof(DebugProxy))]
public class Derived : Base { }

public class DebugProxy(Derived instance)
{
	public string Property => "Value";
}
Image

Expected Behavior

Copy Value should copy Value.
Copy as Expression should copy new Test.DebugProxy((Derived)v).Property.

Actual Behavior

Copy Value copy error CS1503: Argument 1: cannot convert from 'Test.Base' to 'Test.Derived'.
Copy as Expression copy new Test.DebugProxy(v).Property.

Extension version: 2.130.5
VS Code version: Code 1.113.0 (cfbea10c5ffb233ea9177d34726e6056e89913dc, 2026-03-24T15:07:18+01:00)
OS version: Windows_NT x64 10.0.28000
Modes:

Environment Information

VSCode version: 1.113.0
C# Extension: 2.130.5
Using OmniSharp: false

Dotnet Information
.NET SDK:
 Version:           10.0.201
 Commit:            4d3023de60
 Workload version:  10.0.200-manifests.0793c108
 MSBuild version:   18.3.0-release-26153-122+4d3023de6

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.28000
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.201\

.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.5
  Architecture: x64
  Commit:       a612c2a105

.NET SDKs installed:
  10.0.201 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found
Visual Studio Code Extensions
Extension Author Version Folder Name
csharp ms-dotnettools 2.130.5 ms-dotnettools.csharp-2.130.5
vscode-dotnet-runtime ms-dotnettools 3.0.0 ms-dotnettools.vscode-dotnet-runtime-3.0.0
C# Settings
Setting Value
preferCSharpExtension false
compilerDiagnosticScope openFiles
analyzerDiagnosticScope openFiles
enableXamlTools true
useServerGC true
Lingua principale
TypeScript
Stelle
3.1k
Fork
740
Merge medio
1g 3h
PR unite (30g)
52

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/vscode-csharp

Tutte le issue di dotnet/vscode-csharp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.