-
Notifications
You must be signed in to change notification settings - Fork 258
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
Created project.assets.json does not contain all assets #12406
Comments
@Stefan75 at the moment this is by design. This particular package only contains MSBuild logic which extends your project's build by adding items to be copied to the output directory. https://nuget.info/packages/NUnit3TestAdapter/4.3.1
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)NUnit3.TestAdapter.dll">
<Link>NUnit3.TestAdapter.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)NUnit3.TestAdapter.pdb" Condition="Exists('$(MSBuildThisFileDirectory)NUnit3.TestAdapter.pdb')">
<Link>NUnit3.TestAdapter.pdb</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)nunit.engine.dll">
<Link>nunit.engine.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)nunit.engine.api.dll">
<Link>nunit.engine.api.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)nunit.engine.core.dll">
<Link>nunit.engine.core.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)testcentric.engine.metadata.dll">
<Link>testcentric.engine.metadata.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
</ItemGroup>
</Project> The only asset consumed by NuGet is |
Hello @jeffkl , I created an issue at the nunit repo: They are not sure what would be the proposed solution. I checked other existing solutions: <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)xunit.runner.visualstudio.testadapter.dll">
<Link>xunit.runner.visualstudio.testadapter.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)xunit.runner.reporters.net452.dll">
<Link>xunit.runner.reporters.net452.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)xunit.runner.utility.net452.dll">
<Link>xunit.runner.utility.net452.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<None Include="$(MSBuildThisFileDirectory)xunit.abstractions.dll">
<Link>xunit.abstractions.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
<ProjectCapability Include="TestContainer" />
</ItemGroup>
</Project> and <?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>xunit.runner.visualstudio</id>
<version>2.4.5</version>
<title>xUnit.net [Runner: Visual Studio]</title>
<authors>.NET Foundation and Contributors</authors>
<owners></owners>
<developmentDependency>true</developmentDependency>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">MIT</license>
<icon>logo-512-transparent.png</icon>
<projectUrl>https://github.com/xunit/visualstudio.xunit</projectUrl>
<description>Visual Studio 2019 16.8+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 4.7.2 or later, .NET Core 3.1 or later, and Universal Windows 10.0.16299 or later.</description>
<copyright>Copyright (c) .NET Foundation and Contributors.</copyright>
<repository type="git" url="https://github.com/xunit/visualstudio.xunit" commit="1caef2f33e9cda2f6bf93557aedbea4d297ac3b8" />
<dependencies>
<group targetFramework=".NETFramework4.6.2" />
<group targetFramework=".NETCoreApp3.1" />
<group targetFramework="UAP10.0.16299" />
</dependencies>
</metadata>
</package> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<TestAdapterContent Include="$(MSBuildThisFileDirectory)Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll">
<Link>Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</TestAdapterContent>
<TestAdapterContent Include="$(MSBuildThisFileDirectory)Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll">
<Link>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</TestAdapterContent>
<TestAdapterContent Include="$(MSBuildThisFileDirectory)\Microsoft.TestPlatform.AdapterUtilities.dll">
<Link>Microsoft.TestPlatform.AdapterUtilities.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</TestAdapterContent>
</ItemGroup>
<ItemGroup>
<!--
Including `@(TestAdapterContent)` in the `None` ItemGroup to get the `CopyToOutputDirectory` behavior be default,
package consumers can opt-out of this behavior by removing `@(TestAdapterContent)` from the `None` ItemGroup
(i.e. `<None Remove="@(TestAdapterContent)" />`)
-->
<None Include="@(TestAdapterContent)" />
</ItemGroup>
</Project> and <?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>MSTest.TestAdapter</id>
<version>3.0.2</version>
<title>MSTest.TestAdapter</title>
<authors>Microsoft</authors>
<owners>Microsoft</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<license type="expression">MIT</license>
<icon>Icon.png</icon>
<projectUrl>https://github.com/microsoft/testfx</projectUrl>
<iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
<description>The adapter to discover and execute MSTest Framework based tests.
Supported platforms:
- .NET 4.6.2+
- .NET Core 3.1+ (Universal Windows Apps 10+)
- .NET 6.0
- .NET 6.0 Windows.18362+
- ASP.NET Core 1.0+</description>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
<tags>MSTest TestFramework TestAdapter VisualStudio Unittest MSTestV2 Microsoft</tags>
<repository type="git" url="https://github.com/microsoft/testfx" branch="rel/3.0.2" commit="9c34076eaf2fb204da9cc56d5b9c10d189314f69" />
<dependencies>
<group targetFramework=".NETStandard2.0" />
<group targetFramework=".NETFramework4.6.2" />
<group targetFramework="UAP10.0" />
<group targetFramework=".NETCoreApp3.1" />
<group targetFramework="net6.0" />
</dependencies>
</metadata>
</package> It seems that all test adapter packages are using a different approach than the suggested one from you. Would you please so kind to elobrate your suggestion a little bit more? See comment from @OsirisTerje
Regards, |
The short summary is that this package has implemented the copying of files to the output directory in a custom way so NuGet does not report their existence in the assets file since they are not considered content files, reference assemblies, etc. |
NuGet Product Used
MSBuild.exe
Product Version
MSBuild version 17.4.1+9a89d02ff for .NET Framework 17.4.1.60106
Worked before?
no
Impact
It's more difficult to complete my work
Repro Steps & Context
Hello,
I created a C# project with the package reference
NUnit3TestAdapter
.After restore and build, I find following files in
bin\debug\net4.8
:I would have expected that in the first section these files are listed:
Is this a bug?
If this is not a bug, how can I determine the actual copied files for each NuGet package?
(Important for use-cases like SBOM, mapping Files to the source NuGet package)
Regards,
stefan
Verbose Logs
After restore and build, I find following files in
bin\debug\net4.8
:But If I look into the created
project.assets.json
file:I would have expected that in the first section these files are listed:
If I add as an additional component
NUnit
to, then the first section includes these assemblies:The text was updated successfully, but these errors were encountered: