`dotnet test` does not work for WASM libraries tests
@akoeplinger is already working on this.
Since Sep 9, 2025.
Assessment
This issue has not been assessed yet.
Description
Writing this purely in the spirit of https://github.com/dotnet/runtime/issues/94183#issuecomment-3254389607, feel free to close / move this issue.
Currently if you try to do:
dotnet test /p:TargetOS=wasi /p:TargetArchitecture=wasm .\tests\System.Collections.Specialized.Tests.csproj
It will fail with:
Settings file provided does not conform to required format. An error occurred while loading the settings. Error: Invalid setting 'RunConfiguration'. Invalid value 'wasm' specified for 'TargetPlatform'..
Unhandled exception. System.TypeInitializationException: The type initializer for 'Microsoft.VisualStudio.TestPlatform.Client.TestPlatform' threw an exception.
---> Microsoft.VisualStudio.TestPlatform.ObjectModel.SettingsException: Invalid settings 'RunConfiguration'. Invalid value 'wasm' specified for 'TargetPlatform'.
at Microsoft.VisualStudio.TestPlatform.ObjectModel.RunConfiguration.FromXml(XmlReader reader) in /_/src/vstest/src/Microsoft.TestPlatform.ObjectModel/RunSettings/RunConfiguration.cs:line 781
at Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities.XmlRunSettingsUtilities.GetNodeValue[T](String settingsXml, String nodeName, Func`2 nodeParser) in /_/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs:line 377
at Microsoft.VisualStudio.TestPlatform.ObjectModel.Utilities.XmlRunSettingsUtilities.GetRunConfigurationNode(String settingsXml) in /_/src/vstest/src/Microsoft.TestPlatform.ObjectModel/Utilities/XmlRunSettingsUtilities.cs:line 136
at Microsoft.VisualStudio.TestPlatform.Client.TestPlatform.AddExtensionAssembliesFromExtensionDirectory() in /_/src/vstest/src/Microsoft.TestPlatform.Client/TestPlatform.cs:line 283
--- End of inner exception stack trace ---
dotnet msbuild /t:Test works as expected:
dotnet msbuild /p:TargetOS=wasi /p:TargetArchitecture=wasm /t:Test .\tests\System.Collections.Specialized.Tests.csproj
...
info: === TEST EXECUTION SUMMARY ===
info: Tests run: 2131 Passed: 2123 Inconclusive: 0 Failed: 0 Ignored: 0 Skipped: 8
...
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·