Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#, visual studio code, debugger, Error processing variables request. Unknown Error: 0x80131502

I am using visual studio code and C# DevKit (v 1.0.12 ) and (v0.5.150). I am not able to debug my xunit tests. an example of my tests :

[Fact]
public async Task Shoud_Do_Something()
{
    var a = 5;
    var b = 6;
    var c = a + b;
}

and the error is shown here :

enter image description here

and for my csproj file code is here

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="coverlet.msbuild" Version="6.0.0">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="Microsoft.Data.Sqlite" Version="6.0.14" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.14" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="6.0.14" />
    <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables"
      Version="7.0.0" />
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
    <PackageReference Include="xunit" Version="2.4.2" />
    <PackageReference Include="FluentAssertions" Version="6.8.0" />
    <PackageReference Include="Moq" Version="4.18.2" />
    <PackageReference Include="Xunit.DependencyInjection" Version="8.6.1" />
    <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
    <PackageReference Include="coverlet.collector" Version="3.1.2">
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>
  </ItemGroup>
</Project>

Does any one got the same issue ? Many thanks in advance.

like image 904
Ghassen Avatar asked Oct 17 '25 19:10

Ghassen


1 Answers

Using Visual studio code :

The issue was simply due to the length of the path of the csporj file, the path has exceeded 256 characters. I justed renamed the csproj files and it worked fine.

Using Visual studio :

If you use viusal studio for tests, this will not work even if you update the longpath property in the registery database as it is doing its own validation

like image 86
Ghassen Avatar answered Oct 20 '25 08:10

Ghassen