Skip to content

Microsoft.NET.Test.Sdk package is not transitive (request for moving content from build to buildTransitive) #3227

Closed

Description

Description

In package Microsoft.NET.Test.Sdk move build folder content to buildTransitive. This feature can simplify working with tests hierarchy. For now we forced to reference Microsoft.NET.Test.Sdk in each test project which is inconvenient.

Even when we use PrivateAssets="contentfiles;analyzers" it works only for one hierarchy layer (TestSDKNotTransitive_WithPrivateAssets project B works correctly but C does not )

Steps to reproduce

  1. call dotnet test B.dll in .\TestSDKNotTransitive\B\bin\Debug\net5.0\ from TestSDKNotTransitive.zip
  2. call dotnet test C.dll in .\TestSDKNotTransitive_WithPrivateAssets\C\bin\Debug\net5.0\ from TestSDKNotTransitive_WithPrivateAssets.zip

TestSDKNotTransitive.zip
TestSDKNotTransitive_WithPrivateAssets.zip

Expected behavior

Tests from 1 and 2 should be executed

Actual behavior

Testhost process exited with error: A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
Failed to run as a self-contained app.

  • The application was run as a self-contained app because 'C:\Users\nedav\source\repos\TestSDKNotTransitive\B\bin\Debug\net5.0\testhost.runtimeconfig.json' was not found.
  • If this should be a framework-dependent app, add the 'C:\Users\nedav\source\repos\TestSDKNotTransitive\B\bin\Debug\net5.0\testhost.runtimeconfig.json' file and specify the appropriate framework.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions