Skip to content

dotnet test crashes in MTP mode in .NET 10 Preview 4 #48912

Open
@PhilippNaused

Description

@PhilippNaused

Describe the bug

dotnet test crashes if you opt into MTP mode.

Repro steps

Test.csproj

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <EnableMSTestRunner>true</EnableMSTestRunner>
    <OutputType>Exe</OutputType>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
    <PackageReference Include="MSTest" Version="3.8.3" />
  </ItemGroup>
</Project>

dotnet.config

[dotnet.test.runner]
name = "Microsoft.Testing.Platform"

run dotnet test
Result:

Process terminated.
System.Collections.Generic.KeyNotFoundException: The given key '8' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.DotNet.Cli.Commands.Test.TestApplicationsEventHandlers.OnHandshakeReceived(Object sender, HandshakeArgs args)
   at Microsoft.DotNet.Cli.Commands.Test.TestApplication.OnHandshakeMessage(HandshakeMessage handshakeMessage)
   at Microsoft.DotNet.Cli.Commands.Test.TestApplication.OnRequest(IRequest request)
   at System.Environment.FailFast(System.Runtime.CompilerServices.StackCrawlMarkHandle, System.String, System.Runtime.CompilerServices.ObjectHandleOnStack, System.String)
   at System.Environment.FailFast(System.Threading.StackCrawlMark ByRef, System.String, System.Exception, System.String)
   at System.Environment.FailFast(System.String)
   at Microsoft.DotNet.Cli.Commands.Test.TestApplication.OnRequest(Microsoft.DotNet.Cli.Commands.Test.IPC.IRequest)
   at Microsoft.DotNet.Cli.Commands.Test.IPC.NamedPipeServer+<InternalLoopAsync>d__22.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.DotNet.Cli.Commands.Test.IPC.NamedPipeServer+<InternalLoopAsync>d__22, dotnet, Version=10.0.100.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].ExecutionContextCallback(System.Object)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.DotNet.Cli.Commands.Test.IPC.NamedPipeServer+<InternalLoopAsync>d__22, dotnet, Version=10.0.100.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].MoveNext(System.Threading.Thread)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[Microsoft.DotNet.Cli.Commands.Test.IPC.NamedPipeServer+<InternalLoopAsync>d__22, dotnet, Version=10.0.100.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].ExecuteFromThreadPool(System.Threading.Thread)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()

Further technical details

.NET SDK:
 Version:           10.0.100-preview.4.25258.110
 Commit:            c22dcd0c7a
 Workload version:  10.0.100-manifests.e9b6aa6e
 MSBuild version:   17.15.0-preview-25258-110+c22dcd0c7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26100
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.100-preview.4.25258.110\

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions