Skip to content
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

NuGet assemblies not copied to custom output dir #7676

Closed
alecor191 opened this issue Feb 4, 2017 · 2 comments
Closed

NuGet assemblies not copied to custom output dir #7676

alecor191 opened this issue Feb 4, 2017 · 2 comments

Comments

@alecor191
Copy link

Steps to reproduce

  • Use VS 2017 with .csproj and create a .NET Core test project using XUnit
  • Make sure to add XUnit runner package to project:
<PackageReference Include="xunit" Version="2.2.0-beta5-build3474" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta5-build1225" />
  • Configure the .csproj to use a custom output path:
<BaseIntermediateOutputPath>..\..\artifacts\obj\$(MSBuildProjectName)\$(Configuration)\$(ProcessorArchitecture)\</BaseIntermediateOutputPath>
<OutputPath>..\..\artifacts\test\$(MSBuildProjectName)\$(Configuration)\$(ProcessorArchitecture)\</OutputPath>
  • Run the XUnit tests from VS2017 IDE
  • Run the XUnit tests using dotnet test

Expected behavior

Both VS2017 IDE and dotnet test should execute the XUnit tests in the test project.

Actual behavior

VS2017 IDE is able to execute the tests successfully. However, dotnet test fails with the following warning:

Warning: The path '[...]\artifacts\test\<test_project_name>\Debug\net461' specified in the 'TestAdapterPath' does not contain any test adapters, provide a valid path and try again.

Additional info

I noticed the following:

  • My guess is that the execution with dotnet test fails as I can't find xunit.runner.visualstudio assemblies in the output path (xunit.runner.visualstudio.testadapter.dll is missing).
  • If I remove the custom output path settings (i.e. remove both <BaseIntermediateOutputPath> and <OutputPath> from the .csproj file, then dotnet test succeeds. In fact, I see in the default bin directory the files from xunit.runner.visualstudio package (xunit.runner.visualstudio.testadapter.dll).
  • Note that other NuGet package assemblies are properly copied to the custom output directory. I assume those are the dependencies that are also referenced in code; whereas the XUnit runner/testadapter assemblies are not referenced anywhere in the solution.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc3-004530)

Product Information:
Version: 1.0.0-rc3-004530
Commit SHA-1 hash: 0de3338

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.0-rc3-004530

@blackdwarf
Copy link

/cc @Faizan2304 @codito

@TheRealPiotrP
Copy link
Contributor

Moved to the [now public 🍾] microsoft/vstest repo

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants