Repository navigation
Migrate nuspec to MSBuild pack (batch 2: container packages) #16132
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
Merged
Azat Mukhametshin (azat-msft)
merged 8 commits into
microsoft:main
from
azat-msft:migrate-nuspec-to-msbuild-pack
Jun 22, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4668b33
Migrate TranslationLayer package from nuspec to MSBuild pack
azat-msft 86333d0
Migrate Internal.Uwp package from nuspec to MSBuild pack
azat-msft b414d4b
Migrate NET.Test.Sdk package from nuspec to MSBuild pack
azat-msft 32b67a2
Migrate CodeCoverage package from nuspec to MSBuild pack
azat-msft 3602402
Migrate TestHost package from nuspec to MSBuild pack
azat-msft 59834be
Migrate Microsoft.TestPlatform package from nuspec to MSBuild pack
azat-msft e0b61ad
Migrate Microsoft.TestPlatform.Portable package from nuspec to MSBuil…
azat-msft ce9d8c0
Flow Build assets of TestHost/CodeCoverage deps in NET.Test.Sdk pack
azat-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
219 changes: 0 additions & 219 deletions
219
...TestConsole.TranslationLayer/Microsoft.TestPlatform.VsTestConsole.TranslationLayer.nuspec
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
src/package/Microsoft.CodeCoverage/Microsoft.CodeCoverage.nuspec
This file was deleted.
Oops, something went wrong.
70 changes: 51 additions & 19 deletions
70
src/package/Microsoft.NET.Test.Sdk/Microsoft.NET.Test.Sdk.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,42 +1,74 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFrameworks>netstandard2.0</TargetFrameworks> | ||
| <!-- Multi-target so that pack emits per-framework dependency groups (net8.0 and net462). --> | ||
| <TargetFrameworks>net8.0;net462</TargetFrameworks> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <IsPackable Condition="'$(DotNetBuildSourceOnly)' != 'true'">true</IsPackable> | ||
| <NuspecFile>Microsoft.NET.Test.Sdk.nuspec</NuspecFile> | ||
| <NuspecBasePath>$(OutputPath)</NuspecBasePath> | ||
| <PackageId>Microsoft.NET.Test.Sdk</PackageId> | ||
| <PackageTags>vstest visual-studio unittest testplatform mstest microsoft test testing</PackageTags> | ||
| <PackageDescription> | ||
| The MSbuild targets and properties for building .NET test projects. | ||
| </PackageDescription> | ||
| <PackageReadmeFile>README.md</PackageReadmeFile> | ||
| <!-- This is a build/targets-only package: it ships MSBuild props/targets and _._ lib stubs, | ||
| not its own assembly. --> | ||
| <IncludeBuildOutput>false</IncludeBuildOutput> | ||
| <!-- The package's assembly has no sources of its own. --> | ||
| <NoWarn>$(NoWarn);NU5128</NoWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Remove="netcoreapp\Microsoft.NET.Test.Sdk.Program.cs" /> | ||
| <None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.cs" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Package dependencies, expressed per target framework via references to the sibling packable projects. | ||
| net8.0 depends on TestHost and CodeCoverage; net462 depends on CodeCoverage only | ||
| (TestHost gets shipped with vstest.console on .NET Framework). | ||
| PrivateAssets="none" so the generated nuspec dependency does not exclude the Build (and Analyzers) | ||
| assets: consumers must import TestHost's and CodeCoverage's MSBuild props/targets (e.g. the | ||
| Microsoft.TestPlatform.TestHost.props that deploys the testhost.exe apphost). This matches the | ||
| hand-written nuspec, whose dependencies carried no exclude. By default pack emits | ||
| exclude="Build,Analyzers" for a ProjectReference, which would suppress those props. --> | ||
| <ItemGroup Condition="'$(TargetFramework)' == 'net8.0'"> | ||
| <ProjectReference Include="..\Microsoft.TestPlatform.TestHost\Microsoft.TestPlatform.TestHost.csproj" PrivateAssets="none" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.cs" /> | ||
| <ProjectReference Include="..\Microsoft.CodeCoverage\Microsoft.CodeCoverage.csproj" PrivateAssets="none" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- README.md is referenced by PackageReadmeFile. --> | ||
| <ItemGroup> | ||
| <None Include="README.md" Pack="true" PackagePath="" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Ship the MSBuild props/targets into the build and buildMultiTargeting folders. | ||
| The root .props goes to every TFM folder; the .targets vary by TFM: | ||
| - net8.0 uses netcoreapp\Microsoft.NET.Test.Sdk.targets and the Program.* launcher files | ||
| - net462 uses netfx\Microsoft.NET.Test.Sdk.targets | ||
| - netcoreapp2.0 / netstandard2.0 use the root Microsoft.NET.Test.Sdk.targets (incompatibility shim) --> | ||
| <ItemGroup> | ||
| <None Update="_._"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <None Update="Microsoft.NET.Test.Sdk.props"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <None Update="Microsoft.NET.Test.Sdk.targets"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <None Update="netcoreapp\*"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <None Update="netfx\*"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </None> | ||
| <!-- props (same file for all frameworks) --> | ||
| <None Include="Microsoft.NET.Test.Sdk.props" Pack="true" PackagePath="build\net8.0\;build\net462\;build\netcoreapp2.0\;build\netstandard2.0\;buildMultiTargeting\net8.0\;buildMultiTargeting\net462\;buildMultiTargeting\netcoreapp2.0\;buildMultiTargeting\netstandard2.0\" /> | ||
|
|
||
| <!-- net8.0 targets + launcher program files --> | ||
| <None Include="netcoreapp\Microsoft.NET.Test.Sdk.targets" Pack="true" PackagePath="build\net8.0\" /> | ||
| <None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.cs" Pack="true" PackagePath="build\net8.0\" /> | ||
| <None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.fs" Pack="true" PackagePath="build\net8.0\" /> | ||
| <None Include="netcoreapp\Microsoft.NET.Test.Sdk.Program.vb" Pack="true" PackagePath="build\net8.0\" /> | ||
|
|
||
| <!-- net462 targets --> | ||
| <None Include="netfx\Microsoft.NET.Test.Sdk.targets" Pack="true" PackagePath="build\net462\" /> | ||
|
|
||
| <!-- netcoreapp2.0 / netstandard2.0 incompatibility-shim targets (root targets file) --> | ||
| <None Include="Microsoft.NET.Test.Sdk.targets" Pack="true" PackagePath="build\netcoreapp2.0\;build\netstandard2.0\;buildMultiTargeting\netcoreapp2.0\;buildMultiTargeting\netstandard2.0\" /> | ||
|
|
||
| <!-- Empty lib stubs (no assembly is shipped). lib/native/_._ marks the package compatible with | ||
| native (C++) test projects. Note: the previous nuspec also declared an empty native0.0 | ||
| dependency group; MSBuild pack only emits dependency groups for real build TFMs, so that empty | ||
| group is dropped. This is behaviorally equivalent since the group carried no dependencies. --> | ||
| <None Include="_._" Pack="true" PackagePath="lib\net8.0\;lib\net462\;lib\native\" /> | ||
| </ItemGroup> | ||
| </Project> |
54 changes: 0 additions & 54 deletions
54
src/package/Microsoft.NET.Test.Sdk/Microsoft.NET.Test.Sdk.nuspec
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.