dotnet / dotnet/vscode-csharp

OmniSharp: XUnit tests debug the wrong process

Open
#8,133 9 comments 0 reactions 0 assignees View on GitHub
OmniSharp Test
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

Type: Bug

## Issue Description ##
Basically, what the title says. Using debugger from Run and Debug working perfectly fine; the buttons Run test and Run all tests also doing their job. Also, tried to log pid in stdout, but couldn't find it anywhere.
## Steps to Reproduce ##
Create blank `xunit3` template and add breakpoint somewhere in the test or throw an exception
## Expected Behavior ##
Break occuring on breakpoint; ability to see variables values
## Actual Behavior ##
No break occuring; blank variables section

![Image](https://github.com/user-attachments/assets/a307e452-2345-4991-b394-3ddd48fe9c7b)

## Logs ##
Logging without `Thread.Sleep`:

Output

```
----- Debugging test method issue.UnitTest1.Test1 -----

c:\Users\probel\Desktop\issue\UnitTest1.cs(14,9): warning CS0162: Обнаружен недостижимый код [c:\Users\probel\Desktop\issue\issue.csproj]
c:\Users\probel\Desktop\issue\UnitTest1.cs(8,13): warning CS0219: Переменной "a" присвоено значение, но оно ни разу не использовано. [c:\Users\probel\Desktop\issue\issue.csproj]
issue -> c:\Users\probel\Desktop\issue\bin\Debug\net8.0\issue.dll

Сборка успешно завершена.

c:\Users\probel\Desktop\issue\UnitTest1.cs(14,9): warning CS0162: Обнаружен недостижимый код [c:\Users\probel\Desktop\issue\issue.csproj]
c:\Users\probel\Desktop\issue\UnitTest1.cs(8,13): warning CS0219: Переменной "a" присвоено значение, но оно ни разу не использовано. [c:\Users\probel\Desktop\issue\issue.csproj]
Предупреждений: 2
Ошибок: 0

Прошло времени 00:00:01.61

[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.0.2+dd36e86129 (64-bit .NET 8.0.7)
[xUnit.net 00:00:00.15] Discovering: issue
[xUnit.net 00:00:00.28] Discovered: issue
Started debugging process #5848.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v3.0.2+dd36e86129 (64-bit .NET 8.0.7)
[xUnit.net 00:00:00.35] Starting: issue
[xUnit.net 00:00:00.41] issue.UnitTest1.Test1 [FAIL]
[xUnit.net 00:00:00.41] System.Exception : Exception of type 'System.Exception' was thrown.
[xUnit.net 00:00:00.41] Stack Trace:
[xUnit.net 00:00:00.41] c:\Users\probel\Desktop\issue\UnitTest1.cs(12,0): at issue.UnitTest1.Test1()
[xUnit.net 00:00:00.41] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
[xUnit.net 00:00:00.41] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[xUnit.net 00:00:00.42] Finished: issue
Debugging complete.
```

Debug console

```
------------------------------------------------------------------------------
You may only use the Microsoft Visual Studio .NET/C/C++ Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you
develop and test your applications.
------------------------------------------------------------------------------
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\testhost.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\Microsoft.TestPlatform.CoreUtilities.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Diagnostics.Tracing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Diagnostics.Debug.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Diagnostics.Process.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.ComponentModel.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\Microsoft.TestPlatform.PlatformAbstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Collections.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\Microsoft.TestPlatform.CrossPlatEngine.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\netstandard.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\Microsoft.TestPlatform.CommunicationUtilities.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\Microsoft.VisualStudio.TestPlatform.Common.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\Newtonsoft.Json.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.Serialization.Formatters.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Collections.Concurrent.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Diagnostics.TraceSource.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.IO.FileSystem.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Memory.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\Microsoft.Win32.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Threading.ThreadPool.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Net.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Collections.NonGeneric.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Net.Sockets.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Private.Uri.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Threading.Overlapped.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.Intrinsics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Linq.Expressions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.Numerics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.ComponentModel.TypeConverter.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.ObjectModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.Serialization.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Data.Common.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Xml.ReaderWriter.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Private.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.ComponentModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Reflection.Emit.ILGeneration.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Reflection.Emit.Lightweight.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Reflection.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'Anonymously Hosted DynamicMethods Assembly'.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\ru\Microsoft.VisualStudio.TestPlatform.Common.resources.dll'. Module was built without symbols.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.Loader.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.IO.MemoryMappedFiles.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Text.Encoding.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\xunit.runner.visualstudio.testadapter.dll'. Module was built without symbols.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\xunit.runner.visualstudio.testadapter.dll'. Module was built without symbols.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Threading.Tasks.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Net.Http.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\xunit.abstractions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Runtime.InteropServices.RuntimeInformation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Xml.XDocument.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Private.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Threading.Thread.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Text.RegularExpressions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
testhost.exe (5848): Loaded 'c:\Users\probel\Desktop\issue\bin\Debug\net8.0\issue.dll'. Символы загружены.
testhost.exe (5848): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.7\System.Security.Cryptography.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The program '[5848] testhost.exe' has exited with code 0 (0x0).
```

### OmniSharp log ###

```
Starting OmniSharp server at 4/4/2025, 3:38:04 AM
Target: c:\Users\probel\Desktop\issue

OmniSharp server started with .NET 8.0.303.
Path: c:\Users\probel\.vscode\extensions\ms-dotnettools.csharp-2.72.22-win32-x64\.omnisharp\1.39.12-net6.0\OmniSharp.dll
PID: 1540

<…>

[dbug]: OmniSharp.Roslyn.BufferManager
Updating file c:\Users\probel\Desktop\issue\UnitTest1.cs with new text:
namespace issue;

public class UnitTest1
{
[Fact]
public void Test1()
{
var a = "string";

// System.Threading.Thread.Sleep(-1);

throw new Exception();

Assert.True(true);
}
}

[dbug]: OmniSharp.Stdio.Host
************ Response (0.7900ms) ************
{
"Request_seq": 476,
"Command": "/updatebuffer",
"Running": true,
"Success": true,
"Message": null,
"Body": true,
"Seq": 2417,
"Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 477,
"Command": "/codecheck",
"Arguments": {
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs"
}
}
[dbug]: OmniSharp.Stdio.Host
************ Response (0.6128ms) ************
{
"Request_seq": 477,
"Command": "/codecheck",
"Running": true,
"Success": true,
"Message": null,
"Body": {
"QuickFixes": [
{
"LogLevel": "Info",
"Id": "IDE0059",
"Tags": [
"Unnecessary"
],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 7,
"Column": 12,
"EndLine": 7,
"EndColumn": 13,
"Text": "Ненужное присваивание значения \"a\"",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "IDE0035",
"Tags": [
"Unnecessary"
],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 12,
"Column": 0,
"EndLine": 14,
"EndColumn": 0,
"Text": "Обнаружен недостижимый код",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "IDE0008",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 7,
"Column": 8,
"EndLine": 7,
"EndColumn": 11,
"Text": "Использовать явный тип вместо var",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "IDE0160",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 0,
"Column": 0,
"EndLine": 0,
"EndColumn": 16,
"Text": "Преобразовать в namespace с заданной областью видимости блока",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "CA2201",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 11,
"Column": 14,
"EndLine": 11,
"EndColumn": 29,
"Text": "Тип исключения System.Exception является недостаточно определенным.",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "IDE0055",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 12,
"Column": 0,
"EndLine": 12,
"EndColumn": 8,
"Text": "Исправить форматирование",
"Projects": [
"issue"
]
},
{
"LogLevel": "Warning",
"Id": "CS0162",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 13,
"Column": 8,
"EndLine": 13,
"EndColumn": 14,
"Text": "Обнаружен недостижимый код",
"Projects": [
"issue"
]
},
{
"LogLevel": "Warning",
"Id": "CS0219",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 7,
"Column": 12,
"EndLine": 7,
"EndColumn": 13,
"Text": "Переменной \"a\" присвоено значение, но оно ни разу не использовано.",
"Projects": [
"issue"
]
}
]
},
"Seq": 2426,
"Type": "response"
}
[dbug]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 478,
"Command": "/codecheck",
"Arguments": {}
}
[dbug]: OmniSharp.Stdio.Host
************ Response (0.1580ms) ************
{
"Request_seq": 478,
"Command": "/codecheck",
"Running": true,
"Success": true,
"Message": null,
"Body": {
"QuickFixes": [
{
"LogLevel": "Info",
"Id": "IDE0059",
"Tags": [
"Unnecessary"
],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 7,
"Column": 12,
"EndLine": 7,
"EndColumn": 13,
"Text": "Ненужное присваивание значения \"a\"",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "IDE0035",
"Tags": [
"Unnecessary"
],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 12,
"Column": 0,
"EndLine": 14,
"EndColumn": 0,
"Text": "Обнаружен недостижимый код",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "IDE0008",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 7,
"Column": 8,
"EndLine": 7,
"EndColumn": 11,
"Text": "Использовать явный тип вместо var",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "IDE0160",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 0,
"Column": 0,
"EndLine": 0,
"EndColumn": 16,
"Text": "Преобразовать в namespace с заданной областью видимости блока",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "CA2201",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 11,
"Column": 14,
"EndLine": 11,
"EndColumn": 29,
"Text": "Тип исключения System.Exception является недостаточно определенным.",
"Projects": [
"issue"
]
},
{
"LogLevel": "Hidden",
"Id": "IDE0055",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 12,
"Column": 0,
"EndLine": 12,
"EndColumn": 8,
"Text": "Исправить форматирование",
"Projects": [
"issue"
]
},
{
"LogLevel": "Warning",
"Id": "CS0162",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 13,
"Column": 8,
"EndLine": 13,
"EndColumn": 14,
"Text": "Обнаружен недостижимый код",
"Projects": [
"issue"
]
},
{
"LogLevel": "Warning",
"Id": "CS0219",
"Tags": [],
"FileName": "c:\\Users\\probel\\Desktop\\issue\\UnitTest1.cs",
"Line": 7,
"Column": 12,
"EndLine": 7,
"EndColumn": 13,
"Text": "Переменной \"a\" присвоено значение, но оно ни разу не использовано.",
"Projects": [
"issue"
]
}
]
},
"Seq": 2429,
"Type": "response"
}
```


### C# log ###
Emptiness here...

## Environment information ##

**VSCode version**: 1.98.2
**C# Extension**: 2.72.22
**Using OmniSharp**: true

Dotnet Information
.NET SDK:
Version: 8.0.303
Commit: 29ab8e3268
Workload version: 8.0.300-manifests.c915c39d
MSBuild version: 17.10.4+10fbfbf2e

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

.NET workloads installed:
There are no installed workloads to display.

Host:
Version: 8.0.7
Architecture: x64
Commit: 2aade6beb0

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

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

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions

|Extension|Author|Version|Folder Name|
|---|---|---|---|
|csharp|ms-dotnettools|2.72.22|ms-dotnettools.csharp-2.72.22-win32-x64|
|vscode-dotnet-runtime|ms-dotnettools|2.3.1|ms-dotnettools.vscode-dotnet-runtime-2.3.1|;

Extension version: 2.72.22
VS Code version: Code 1.98.2 (ddc367ed5c8936efe395cffeec279b04ffd7db78, 2025-03-12T13:32:45.399Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|12th Gen Intel(R) Core(TM) i7-1255U (12 x 2611)|
|GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|15.63GB (8.84GB free)|
|Process Argv|--crash-reporter-id c76a1231-7566-45b1-aff2-85506b939125|
|Screen Reader|no|
|VM|0%|

A/B Experiments

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
a9j8j154:30646983
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupytercf:31046870
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc1:31192215
5fd0e150:31155592
dwcopilot:31170013
471b6256:31263136
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
f27dg485:31264363
968h8231:31277804
jda6j935:31233686
pythoneinst12cf:31262606
bgtreat:31268568
fh1c7952:31258891
4gafe986:31271826
563cc122:31253270
31787653:31262186
3e8i5726:31271747
49da9784:31264548

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.