Skip to content
Closed
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 Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ModernUwpMinimum>net9.0-windows10.0.17763.0</ModernUwpMinimum>
<WinUiMinimum>net8.0-windows10.0.18362.0</WinUiMinimum>

<SupportedNetFrameworks>net8.0;net9.0</SupportedNetFrameworks>
<SupportedNetFrameworks>net8.0;net9.0;net10.0</SupportedNetFrameworks>
</PropertyGroup>

<!-- Build config -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<dependency id="Microsoft.Testing.Extensions.VSTestBridge" version="$TestingPlatformVersion$" />
<dependency id="Microsoft.Testing.Platform.MSBuild" version="$TestingPlatformVersion$" />
</group>
<group targetFramework="net10.0">
<dependency id="Microsoft.Testing.Extensions.VSTestBridge" version="$TestingPlatformVersion$" />
<dependency id="Microsoft.Testing.Platform.MSBuild" version="$TestingPlatformVersion$" />
</group>
</dependencies>
<readme>PACKAGE.md</readme>
</metadata>
Expand All @@ -35,6 +39,15 @@
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net9.0\MSTest.TestAdapter.props" target="build\net9.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net9.0\MSTest.TestAdapter.targets" target="build\net9.0\" />

<!-- net10.0 -->
<file src="net10.0\buildTransitive\common\MSTest.TestAdapter.props" target="buildTransitive\net10.0\MSTest.TestAdapter.props" />
<file src="net10.0\buildTransitive\common\MSTest.TestAdapter.targets" target="buildTransitive\net10.0\MSTest.TestAdapter.targets" />
<file src="net10.0\MSTestAdapter.PlatformServices.dll" target="buildTransitive\net10.0\" />
<file src="net10.0\MSTest.TestAdapter.dll" target="buildTransitive\net10.0\" />
<file src="net10.0\Microsoft.TestPlatform.AdapterUtilities.dll" target="buildTransitive\net10.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net10.0\MSTest.TestAdapter.props" target="build\net10.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net10.0\MSTest.TestAdapter.targets" target="build\net10.0\" />

<!-- Localization -->
<!-- All TFMs share the same resx + TestAdapter depends on PlatformServices + TestFramework so all resources are available -->
<file src="net8.0\**\*.resources.dll" target="\buildTransitive\_localization\" />
Expand Down
20 changes: 17 additions & 3 deletions src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<metadata>
$CommonMetadataElements$
<dependencies>
<!--
<!--
WARNING! MSTest.TestAdapter shouldn't have dependencies unless they are used by MTP only.
MSTest.TestAdapter dll is not referenced by the test project, unless it uses MTP. So the dependency
MSTest.TestAdapter dll is not referenced by the test project, unless it uses MTP. So the dependency
won't be considered by GenerateBindingRedirects target. When user references the same package and
upgrades it to version that is newer than what we reference, they will get assembly load failures, because
the assembly version is mismatched, and there is not binding redirect to correct it.
Expand All @@ -28,6 +28,11 @@
<dependency id="Microsoft.Testing.Platform.MSBuild" version="$TestingPlatformVersion$" />
<dependency id="MSTest.TestFramework" version="$Version$" />
</group>
<group targetFramework="net10.0">
<dependency id="Microsoft.Testing.Extensions.VSTestBridge" version="$TestingPlatformVersion$" />
<dependency id="Microsoft.Testing.Platform.MSBuild" version="$TestingPlatformVersion$" />
<dependency id="MSTest.TestFramework" version="$Version$" />
</group>
</dependencies>
<readme>PACKAGE.md</readme>
</metadata>
Expand Down Expand Up @@ -65,6 +70,15 @@
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net9.0\MSTest.TestAdapter.props" target="build\net9.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net9.0\MSTest.TestAdapter.targets" target="build\net9.0\" />

<!-- net10.0 -->
<file src="net10.0\buildTransitive\common\MSTest.TestAdapter.props" target="buildTransitive\net10.0\MSTest.TestAdapter.props" />
<file src="net10.0\buildTransitive\common\MSTest.TestAdapter.targets" target="buildTransitive\net10.0\MSTest.TestAdapter.targets" />
<file src="net10.0\MSTestAdapter.PlatformServices.dll" target="buildTransitive\net10.0\" />
<file src="net10.0\MSTest.TestAdapter.dll" target="buildTransitive\net10.0\" />
<file src="net10.0\Microsoft.TestPlatform.AdapterUtilities.dll" target="buildTransitive\net10.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net10.0\MSTest.TestAdapter.props" target="build\net10.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net10.0\MSTest.TestAdapter.targets" target="build\net10.0\" />

<!-- net462 -->
<file src="net462\buildTransitive\common\MSTest.TestAdapter.props" target="buildTransitive\net462\" />
<file src="net462\buildTransitive\common\MSTest.TestAdapter.targets" target="buildTransitive\net462\" />
Expand All @@ -85,7 +99,7 @@
-->
<file src="net462\MSTest.TestFramework.dll" target="buildTransitive\net462\" />

<!--
<!--
Again, for .NET Framework, VSTest considers first MSTest.TestAdapter NuGet package, then considers VS installation.
This can result in TestFramework.Extensions.dll loaded from VS installation which mismatches the other assemblies.
See https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2577652
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<group targetFramework="net9.0">
<dependency id="MSTest.Analyzers" version="$Version$" />
</group>
<group targetFramework="net10.0">
<dependency id="MSTest.Analyzers" version="$Version$" />
</group>
</dependencies>
<readme>PACKAGE.md</readme>
</metadata>
Expand Down Expand Up @@ -51,6 +54,15 @@
<file src="net9.0/MSTest.TestFramework.Extensions.xml" target="buildTransitive/net9.0/" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\net9.0\MSTest.TestFramework.targets" target="build\net9.0\" />

<!-- net10.0 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\net8.0AndLater\MSTest.TestFramework.targets" target="buildTransitive\net10.0\" />
<file src="net10.0/MSTest.TestFramework.dll" target="lib/net10.0/" />
<file src="net10.0/MSTest.TestFramework.xml" target="lib/net10.0/" />
<file src="net10.0/**/MSTest.TestFramework.resources.dll" target="lib/net10.0/" />
<file src="net10.0/MSTest.TestFramework.Extensions.dll" target="buildTransitive/net10.0/" />
<file src="net10.0/MSTest.TestFramework.Extensions.xml" target="buildTransitive/net10.0/" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\net10.0\MSTest.TestFramework.targets" target="build\net10.0\" />

<!-- Source code -->
<file src="$srcroot$/**/*.cs" target="src" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<group targetFramework="net9.0">
<dependency id="MSTest.Analyzers" version="$Version$" />
</group>
<group targetFramework="net10.0">
<dependency id="MSTest.Analyzers" version="$Version$" />
</group>
</dependencies>
<readme>PACKAGE.md</readme>
</metadata>
Expand Down Expand Up @@ -86,6 +89,15 @@
<file src="net9.0-windows10.0.17763.0\MSTest.TestFramework.Extensions.xml" target="buildTransitive\net9.0\uwp" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\net9.0\MSTest.TestFramework.targets" target="build\net9.0\" />

<!-- net10.0 -->
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\buildTransitive\net8.0AndLater\MSTest.TestFramework.targets" target="buildTransitive\net10.0\" />
<file src="net10.0\MSTest.TestFramework.dll" target="lib\net10.0\" />
<file src="net10.0\MSTest.TestFramework.xml" target="lib\net10.0\" />
<file src="net10.0\**\MSTest.TestFramework.resources.dll" target="lib\net10.0\" />
<file src="net10.0\MSTest.TestFramework.Extensions.dll" target="buildTransitive\net10.0\" />
<file src="net10.0\MSTest.TestFramework.Extensions.xml" target="buildTransitive\net10.0\" />
<file src="$RepoRoot$src\TestFramework\TestFramework.Extensions\build\net10.0\MSTest.TestFramework.targets" target="build\net10.0\" />

<!-- Source code -->
<file src="$srcroot$\**\*.cs" target="src" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<!-- Don't use net462 as analyzer testing library brings Newtonsoft.Json 9.0.1 via NuGet.Packaging -->
<TargetFrameworks>net472;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">net8.0</TargetFrameworks>
<TargetFrameworks>net472;$(SupportedNetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">$(SupportedNetFrameworks)</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>

<!-- Analyzers project need to explicitly exclude compile and runtime assets from MSTest.TestFramework NuGet package -->
<!-- This is to ensure that the assembly built from source is what is being used in tests -->
<!-- This will exclude compile and runtime assets from NuGet so that they flow via ProjectReference -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net472;net9.0</TargetFrameworks>
<TargetFrameworks>net472;$(SupportedNetFrameworks)</TargetFrameworks>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<IsTestingPlatformApplication>true</IsTestingPlatformApplication>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net48;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net462;net48;$(SupportedNetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);$(WinUiMinimum)</TargetFrameworks>
<IsNetCoreApp Condition=" '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == '$(WinUiMinimum)' ">true</IsNetCoreApp>
<IsNetCoreApp Condition=" $([System.String]::Copy('$(SupportedNetFrameworks)').Contains('$(TargetFramework)')) OR '$(TargetFramework)' == '$(WinUiMinimum)' ">true</IsNetCoreApp>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp' might be a better option.

<UseInternalTestFramework>true</UseInternalTestFramework>
<OutputType>Exe</OutputType>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;net48;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net462;net48;$(SupportedNetFrameworks)</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);$(WinUiMinimum)</TargetFrameworks>
<IsNetCoreApp Condition=" '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == '$(WinUiMinimum)' ">true</IsNetCoreApp>
<IsNetCoreApp Condition=" $([System.String]::Copy('$(SupportedNetFrameworks)').Contains('$(TargetFramework)')) OR '$(TargetFramework)' == '$(WinUiMinimum)' ">true</IsNetCoreApp>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp' might be a better option.

<RootNamespace>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests</RootNamespace>
<AssemblyName>Microsoft.VisualStudio.TestPlatform.MSTestAdapter.UnitTests</AssemblyName>
<UseInternalTestFramework>true</UseInternalTestFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>$(SupportedNetFrameworks)</TargetFrameworks>
<EnableMSTestRunner>true</EnableMSTestRunner>
<OutputType>Exe</OutputType>
<!-- While we are referencing MSTest here already, we don't get Microsoft.Testing.Platform.MSBuild props transitively. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<NetStandardNetFrameworkHolder>net48</NetStandardNetFrameworkHolder>
<TargetFrameworks>$(NetStandardNetFrameworkHolder);net8.0;net9.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TargetFrameworks);$(WinUiMinimum)</TargetFrameworks>
<IsNetCoreApp Condition=" '$(TargetFramework)' == 'net8.0' OR '$(TargetFramework)' == 'net9.0' OR '$(TargetFramework)' == '$(WinUiMinimum)' ">true</IsNetCoreApp>
<IsNetCoreApp Condition=" $([System.String]::Copy('$(SupportedNetFrameworks)').Contains('$(TargetFramework)')) OR '$(TargetFramework)' == '$(WinUiMinimum)' ">true</IsNetCoreApp>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp' might be a better option.

<RootNamespace>Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests</RootNamespace>
<AssemblyName>Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests</AssemblyName>
<UseInternalTestFramework>true</UseInternalTestFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ public static class TargetFrameworks
{
public static string[] Net { get; } =
[
"net9.0",
"net10.0",
#if !SKIP_INTERMEDIATE_TARGET_FRAMEWORKS
"net9.0",
"net8.0",
#endif
];
Expand Down
Loading