Skip to content
42 changes: 39 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<PropertyGroup Label="Product dependencies">
<!-- AspireHostingTestingVersion is consumed by the build and baked into the shipped MSTest.Sdk
template. It MUST be kept in sync with the literal Aspire.Hosting.Testing PackageVersion
declared near the bottom of this file (the one Dependabot updates). The
_ValidateBundledSdkFeatureVersions target there fails the build if the two drift apart. -->
<AspireHostingTestingVersion>13.2.1</AspireHostingTestingVersion>
<MicrosoftBuildVersion>17.11.48</MicrosoftBuildVersion>
<MicrosoftCodeAnalysisVersion>3.11.0</MicrosoftCodeAnalysisVersion>
Expand All @@ -27,6 +31,10 @@
<MicrosoftNETCoreUniversalWindowsPlatformVersion>6.2.14</MicrosoftNETCoreUniversalWindowsPlatformVersion>
<!-- Test Platform, .NET Test SDK and Object Model -->
<MicrosoftNETTestSdkVersion>18.4.0</MicrosoftNETTestSdkVersion>
<!-- MicrosoftPlaywrightVersion is consumed by the build and baked into the shipped MSTest.Sdk
template. It MUST be kept in sync with the literal Microsoft.Playwright.MSTest.v4
PackageVersion declared near the bottom of this file (the one Dependabot updates). The
_ValidateBundledSdkFeatureVersions target there fails the build if the two drift apart. -->
<MicrosoftPlaywrightVersion>1.60.0</MicrosoftPlaywrightVersion>
<MicrosoftTestingExtensionsFakesVersion>18.1.1</MicrosoftTestingExtensionsFakesVersion>
<!-- Microsoft.Testing.Internal.Framework is an internal-only NuGet (consumed by tests that
Expand Down Expand Up @@ -122,10 +130,38 @@
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.2" />
</ItemGroup>
<!--
Declare below packages that we will be referenced through MSTest.Sdk but don't have direct reference.
This allows dependabot to suggest updates.
Declare below packages that are referenced through MSTest.Sdk but don't have a direct
PackageReference in this repo, so that Dependabot can discover and update them.

The version MUST be a literal here (not an MSBuild property such as
$(MicrosoftPlaywrightVersion)): Dependabot does not update a Central Package Management
PackageVersion whose Version is an MSBuild property interpolation when the package has no
direct PackageReference, so a property-based version silently stops receiving updates.
See dependabot/dependabot-core#5812 and dependabot/dependabot-core#7183.

Each literal version is duplicated as the matching *Version property (defined near the top of
this file) which is the value actually consumed by the build and baked into the MSTest.Sdk
template (see MSTest.Sdk.csproj). The two cannot be unified because the consuming property must
be a plain scalar (an item transform such as @(PackageVersion->...) stored in a property is not
expanded and breaks string concatenation, e.g. MSB4012), while Dependabot needs the literal on
the PackageVersion. The _ValidateBundledSdkFeatureVersions target below fails the build if the
property and the PackageVersion ever drift apart (e.g. after Dependabot bumps only the
PackageVersion), so the duplication can never ship out of sync.
Comment thread
Evangelink marked this conversation as resolved.
-->
<ItemGroup Label="Declared by MSTest.Sdk but not used directly">
<PackageVersion Include="Microsoft.Playwright.MSTest.v4" Version="$(MicrosoftPlaywrightVersion)" />
<PackageVersion Include="Aspire.Hosting.Testing" Version="13.2.1" />
<PackageVersion Include="Microsoft.Playwright.MSTest.v4" Version="1.60.0" />
</ItemGroup>
<Target Name="_ValidateBundledSdkFeatureVersions"
BeforeTargets="CollectPackageReferences;GenerateNuspec;Build;Pack"
Condition=" '$(MSBuildProjectName)' == 'MSTest.Sdk' ">
<PropertyGroup>
<_AspireHostingTestingPackageVersion>@(PackageVersion->WithMetadataValue('Identity', 'Aspire.Hosting.Testing')->'%(Version)')</_AspireHostingTestingPackageVersion>
<_MicrosoftPlaywrightPackageVersion>@(PackageVersion->WithMetadataValue('Identity', 'Microsoft.Playwright.MSTest.v4')->'%(Version)')</_MicrosoftPlaywrightPackageVersion>
</PropertyGroup>
<Error Condition=" '$(AspireHostingTestingVersion)' != '$(_AspireHostingTestingPackageVersion)' "
Text="AspireHostingTestingVersion ('$(AspireHostingTestingVersion)') is out of sync with the 'Aspire.Hosting.Testing' PackageVersion ('$(_AspireHostingTestingPackageVersion)') in Directory.Packages.props. Update the AspireHostingTestingVersion property to match (Dependabot only updates the PackageVersion)." />
<Error Condition=" '$(MicrosoftPlaywrightVersion)' != '$(_MicrosoftPlaywrightPackageVersion)' "
Text="MicrosoftPlaywrightVersion ('$(MicrosoftPlaywrightVersion)') is out of sync with the 'Microsoft.Playwright.MSTest.v4' PackageVersion ('$(_MicrosoftPlaywrightPackageVersion)') in Directory.Packages.props. Update the MicrosoftPlaywrightVersion property to match (Dependabot only updates the PackageVersion)." />
Comment thread
Evangelink marked this conversation as resolved.
</Target>
</Project>