-
Notifications
You must be signed in to change notification settings - Fork 325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test projects sometimes require <OutputType>Exe</OutputType> #191
Comments
I hit this too. It seems .NET Framework tests will run when |
This issue is by design. A multitargeted test project should have following structure:
|
Would it make sense to put something like this in Microsoft.NET.Test.SDK? <OutputType Condition=" $(TargetFramework.StartsWith('netcoreapp') ">Exe</OutputType> |
Why do desktop targeting test projects need to be console applications? In the past a test project did not need to be a console application in order to work. |
IIUC under the hood, the project.json build system had special knowledge about the ‘testRunner’ attribute, and changed compilation slightly to enable unit test to run on .NET Core. (on example: it output the runtimeconfig.json file). I think the experience we’re looking for is that by indicating “this project is a test project”, we’d expect the sdk to figure out things as much as possible…including things such as OutputType.
|
Created #287 as an umbrella issue for discussing the options around this. |
Closing this in favor of #287 |
Description
Migrating existing test projects from project.json => csproj results in class library based test projects. The problem with this is trying to run
dotnet test
fails. This doesn't always seem to be a problem because I've also migrated more complex projects that look to work without the<OutputType>Exe</OutputType>
requirement (added a repro project to show where it does fail).Steps to reproduce
dotnet migrate
this super simple project.dotnet-test-xunit
dependency from the migrated csproj to work around this issue.dotnet restore
dotnet test
Expected behavior
Actual behavior
Environment
dotnet --info:
Microsoft.NET.Test.Sdk version tested:
15.0.0-preview-20161024-02
The text was updated successfully, but these errors were encountered: