Skip to content

Add implicit using even when not using MSTest.Sdk #5589

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
merged 2 commits into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/verify-nupkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function Confirm-NugetPackages {
Write-Verbose "Starting Confirm-NugetPackages."
$expectedNumOfFiles = @{
"MSTest.Sdk" = 15
"MSTest.TestFramework" = 154
"MSTest.TestFramework" = 162
"MSTest.TestAdapter" = 93
"MSTest" = 14
"MSTest.Analyzers" = 56
Expand Down
9 changes: 0 additions & 9 deletions src/Package/MSTest.Sdk/Sdk/Runner/Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,4 @@
<AssemblyMetadata Include="MSTest.Extension.Uid" Value="MSTest.Sdk" />
</ItemGroup>

<!--
Implicit imports
Ensure feature is available and user hasn't opted-out from it.
See https://github.com/dotnet/sdk/blob/f9fdf2c7d94bc86dc443e5a9ffecbd1962b1d85d/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.CSharp.props#L26-L34
-->
<ItemGroup Condition="'$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable'">
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@
$CommonFileElements$

<!-- netstandard2.0 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\others\MSTest.TestFramework.targets" target="buildTransitive\netstandard2.0\" />
<file src="netstandard2.0/Microsoft.VisualStudio.TestPlatform.TestFramework.dll" target="lib/netstandard2.0/" />
<file src="netstandard2.0/Microsoft.VisualStudio.TestPlatform.TestFramework.xml" target="lib/netstandard2.0/" />
<file src="netstandard2.0/**/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" target="lib/netstandard2.0/" />
<file src="netstandard2.0/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" target="lib/netstandard2.0/" />
<file src="netstandard2.0/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml" target="lib/netstandard2.0/" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\netstandard2.0\MSTest.TestFramework.targets" target="build\netstandard2.0\" />

<!-- netcoreapp3.1 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\others\MSTest.TestFramework.targets" target="buildTransitive\netcoreapp3.1\" />
<file src="netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.TestFramework.dll" target="lib/netcoreapp3.1/" />
<file src="netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.TestFramework.xml" target="lib/netcoreapp3.1/" />
<file src="netcoreapp3.1/**/Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" target="lib/netcoreapp3.1/" />
<file src="netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" target="lib/netcoreapp3.1/" />
<file src="netcoreapp3.1/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml" target="lib/netcoreapp3.1/" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\netcoreapp3.1\MSTest.TestFramework.targets" target="build\netcoreapp3.1\" />

<!-- net6.0 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\net6.0AndLater\MSTest.TestFramework.targets" target="buildTransitive\net6.0\" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,32 +47,40 @@
$CommonFileElements$

<!-- netstandard2.0 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\others\MSTest.TestFramework.targets" target="buildTransitive\netstandard2.0\" />
<file src="netstandard2.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" target="lib\netstandard2.0\" />
<file src="netstandard2.0\Microsoft.VisualStudio.TestPlatform.TestFramework.xml" target="lib\netstandard2.0\" />
<file src="netstandard2.0\**\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" target="lib\netstandard2.0\" />
<file src="netstandard2.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" target="lib\netstandard2.0\" />
<file src="netstandard2.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml" target="lib\netstandard2.0\" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\netstandard2.0\MSTest.TestFramework.targets" target="build\netstandard2.0\" />

<!-- net462 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\others\MSTest.TestFramework.targets" target="buildTransitive\net462\" />
<file src="net462\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" target="lib\net462\" />
<file src="net462\Microsoft.VisualStudio.TestPlatform.TestFramework.xml" target="lib\net462\" />
<file src="net462\**\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" target="lib\net462\" />
<file src="net462\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" target="lib\net462\" />
<file src="net462\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml" target="lib\net462\" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\net462\MSTest.TestFramework.targets" target="build\net462\" />

<!-- uap10.0 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\others\MSTest.TestFramework.targets" target="buildTransitive\uap10.0\" />
<file src="uap10.0.16299\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" target="lib\uap10.0\" />
<file src="uap10.0.16299\Microsoft.VisualStudio.TestPlatform.TestFramework.xml" target="lib\uap10.0\" />
<file src="uap10.0.16299\**\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" target="lib\uap10.0\" />
<file src="uap10.0.16299\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" target="lib\uap10.0\" />
<file src="uap10.0.16299\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml" target="lib\uap10.0\" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\uap10.0\MSTest.TestFramework.targets" target="build\uap10.0\" />

<!-- netcoreapp3.1 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\others\MSTest.TestFramework.targets" target="buildTransitive\netcoreapp3.1\" />
<file src="netcoreapp3.1\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" target="lib\netcoreapp3.1\" />
<file src="netcoreapp3.1\Microsoft.VisualStudio.TestPlatform.TestFramework.xml" target="lib\netcoreapp3.1\" />
<file src="netcoreapp3.1\**\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" target="lib\netcoreapp3.1\" />
<file src="netcoreapp3.1\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" target="lib\netcoreapp3.1\" />
<file src="netcoreapp3.1\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.xml" target="lib\netcoreapp3.1\" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\netcoreapp3.1\MSTest.TestFramework.targets" target="build\netcoreapp3.1\" />

<!-- net6.0 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\net6.0AndLater\MSTest.TestFramework.targets" target="buildTransitive\net6.0\" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\buildTransitive\net462\MSTest.TestFramework.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\buildTransitive\netcoreapp3.1\MSTest.TestFramework.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\buildTransitive\netstandard2.0\MSTest.TestFramework.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<Import Project="$(MSBuildThisFileDirectory)..\..\buildTransitive\uap10.0\MSTest.TestFramework.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@
</Reference>
</ItemGroup>

<!--
Implicit imports
Ensure feature is available and user hasn't opted-out from it.
See https://github.com/dotnet/sdk/blob/f9fdf2c7d94bc86dc443e5a9ffecbd1962b1d85d/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.CSharp.props#L26-L34
-->
<ItemGroup Condition="'$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable'">
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>

<!--
Implicit imports
Ensure feature is available and user hasn't opted-out from it.
See https://github.com/dotnet/sdk/blob/f9fdf2c7d94bc86dc443e5a9ffecbd1962b1d85d/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.CSharp.props#L26-L34
-->
<ItemGroup Condition="'$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable'">
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
</Project>
Loading