Skip to content

[.NET 10, MTP mode] dotent test with --solution option doesn't work as expected and useless in current implementation. #6714

@Romfos

Description

@Romfos

Describe the bug

dotent test for --solution doesn't work as expected and useless in current implementation

If solution have not only test projects you will get an error:

Test run summary: Zero tests ran
Unhandled exception: One or more errors occurred. (Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, net5.0) and have OutputType 'Exe'.
The current OutputType is 'Library'.) (Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, net5.0) and have OutputType 'Exe'.
The current OutputType is 'Library'.)
  total: 0
  failed: 0
  succeeded: 0
  skipped: 0
  duration: 1s 088ms
Error: Process completed with exit code 1.

Steps To Reproduce

  1. add dotnet.config for mtp
  2. Create new solution
  3. Add empty class library
  4. Add valid test project with 1 green test. Test project should be configured for MTP
  5. run dotnet test --solution <path>.

Expected behavior

Only test project is executed and tests are green

Actual behavior

Test run summary: Zero tests ran
Unhandled exception: One or more errors occurred. (Unable to run your project.
Ensure you have a runnable project type and ensure 'dotnet run' supports this project.
A runnable project should target a runnable TFM (for instance, net5.0) and have OutputType 'Exe'.
The current OutputType is 'Library'.)
  total: 0
  failed: 0
  succeeded: 0
  skipped: 0
  duration: 1s 088ms
Error: Process completed with exit code 1.

Additional context

  • .NET 10 RC1
  • dotnet.config configured for MTP mode
  • MsTest 4.0.0 used as test framework, but looks like this is dotnet test bug

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions