Why does MSTest.TestAdapter adds its DLLs into my NuGet package?

偶尔善良 提交于 2021-02-10 07:54:55

问题


I have NuGet package with some custom testing utilities. It's project is referencing MSTest.TestFramework and MSTest.TestAdapter NuGet packages, and corresponding dependencies are specified in nuspec file. Files section only specifies pdb file of project itself to be added.

Yet, I'm constantly getting DLLs related to MSTest.TestAdapter in content folder of NuGet package. Why does this happen? I can't figure out by the documentation. Can I somehow configure dependencies to not include any files?

My nuspec looks like this

<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <id>TestUtils</id>
    <version>1.0.0</version>
    <title>TestUtils</title>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Test utilities</description>
    <dependencies>
      <dependency id="MSTest.TestFramework" version="1.1.18" exclude="contentFiles"/>
      <dependency id="MSTest.TestAdapter" version="1.1.18" exclude="contentFiles"/>
    </dependencies>   
  </metadata>
  <files>
    <file src="bin\$configuration$\$id$.pdb" target="lib\net461"/>
  </files> 
</package>

来源:https://stackoverflow.com/questions/50905870/why-does-mstest-testadapter-adds-its-dlls-into-my-nuget-package

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!