当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Xunit.runner.visualstudio is adding dlls to nuget package Content folder

问题描述:

Short question:

When I add a dependency to XUnit.Runner.VisualStudio to a project that generates a Nuget package with a Content folder, it adds three dlls to the Content folder of the generated Nuget package. Why is this, and how can I stop it?

Background:

So I have a nuget package we use to set up test projects for our company. I combines various internal and external tools and dependencies so that setting up new test projects only involves installing a single nuget package.

Recently I've been updating it to use XUnit 2.0.0.

Seeing that the newer XUnit templates reference XUnit.Runner.VisualStudio, I referenced it as well. Once I did that I noticed that the generated Nuget package had 3 dlls added to the Content folder:

  • xunit.abstractions.dll
  • xunit.runner.utility.desktop
  • xunit.runner.visualstudio.testadapter.dll

Here is the only portion of the nuspec file outside of the meta-data:

<files>

<file src="Content\AutoDataAttribute.cs.pp" target="content" />

</files>

If I remove this line so that no content folder is generated the dlls are not added.

I build the package using this command:

nuget pack $projectFile -Build -Symbols -IncludeReferencedProjects -Prop Configuration=Release -OutputDirectory $projectPath\bin\Release

I'm stumped on this one. Why would xunit.visualstudio.runners add dlls to the content folder? Why would it only do it when I'm generating a content folder and adding a file to it with an explicit reference?

分享给朋友:
您可能感兴趣的文章:
随机阅读: