Skip to content

[msbuild-quality] MSBuild File Quality Report β€” 2026-06-11Β #9023

@Evangelink

Description

@Evangelink

πŸ”§ MSBuild File Quality Report β€” 2026-06-11

Files reviewed: 100
Findings: πŸ”΄ 1 error Β· 🟑 2 warnings Β· πŸ”΅ 0 suggestions


πŸ”΄ Errors

src/Package/MSTest.Sdk/Sdk/Runner/Common.targets

  • Rule B-2 β€” Unquoted property reference on the left side of == in a condition
    • Lines: 7
    • Current:
      <TestingExtensionsProfile Condition=" $(TestingExtensionsProfile) == '' ">Default</TestingExtensionsProfile>
    • Suggested:
      <TestingExtensionsProfile Condition=" '$(TestingExtensionsProfile)' == '' ">Default</TestingExtensionsProfile>
    • Impact: When $(TestingExtensionsProfile) is empty MSBuild evaluates == '' without a left-hand token, which happens to work today but is fragile. Per Rule B-2, both sides of == / != must be single-quoted to be safe against property values that contain spaces or special characters. Every other condition guard in this file and across this codebase correctly follows the '$(Prop)' == '' form; this one is the outlier. This file ships inside the MSTest.Sdk NuGet package and is evaluated for every consumer project.

🟑 Warnings

src/Package/MSTest.Sdk/Sdk/Sdk.targets

  • Rule B-2 β€” MSBuild function-call result not single-quoted on the left side of ==
    • Lines: 6
    • Current:
      <IsTestApplication Condition=" '$(IsTestApplication)' == '' AND $([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETStandard' ">false</IsTestApplication>
    • Suggested:
      <IsTestApplication Condition=" '$(IsTestApplication)' == '' AND '$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'))' == '.NETStandard' ">false</IsTestApplication>
    • Impact: The first half of the compound condition is correctly quoted; the second half is not. MSBuild property-function calls return deterministic framework-identifier strings (.NETStandard, .NETCoreApp, etc.) so this is unlikely to cause a runtime failure today, but the inconsistency within the same Condition="" attribute is a maintenance hazard and diverges from MSBuild best-practice. This file ships in the MSTest.Sdk NuGet package and is the outermost .targets evaluated for every SDK-style consumer.

test/Directory.Build.targets

  • Rule B-2 β€” MSBuild function-call result not single-quoted on the left side of ==
    • Lines: 16
    • Current:
      <TestingPlatformCommandLineArguments Condition=" $([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp' ">$(TestingPlatformCommandLineArguments) --crashdump</TestingPlatformCommandLineArguments>
    • Suggested:
      <TestingPlatformCommandLineArguments Condition=" '$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)'))' == '.NETCoreApp' ">$(TestingPlatformCommandLineArguments) --crashdump</TestingPlatformCommandLineArguments>
    • Impact: Same class of defect as the Sdk.targets finding above, but in test-only infrastructure so the blast radius is limited to this repo's own test runs. Lower priority than the SDK findings; flagged for consistency.

Files reviewed without findings (97)
  • src/Adapter/MSTest.TestAdapter/build/net462/MSTest.TestAdapter.props
  • src/Adapter/MSTest.TestAdapter/build/net462/MSTest.TestAdapter.targets
  • src/Adapter/MSTest.TestAdapter/build/net8.0/MSTest.TestAdapter.props
  • src/Adapter/MSTest.TestAdapter/build/net8.0/MSTest.TestAdapter.targets
  • src/Adapter/MSTest.TestAdapter/build/net9.0/MSTest.TestAdapter.props
  • src/Adapter/MSTest.TestAdapter/build/net9.0/MSTest.TestAdapter.targets
  • src/Adapter/MSTest.TestAdapter/build/uap10.0/MSTest.TestAdapter.props
  • src/Adapter/MSTest.TestAdapter/build/uap10.0/MSTest.TestAdapter.targets
  • src/Adapter/MSTest.TestAdapter/buildTransitive/Parallelize.targets
  • src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.props
  • src/Adapter/MSTest.TestAdapter/buildTransitive/common/MSTest.TestAdapter.targets
  • src/Adapter/MSTest.TestAdapter/buildTransitive/uwp/MSTest.TestAdapter.props
  • src/Adapter/MSTest.TestAdapter/buildTransitive/uwp/MSTest.TestAdapter.targets
  • src/Analyzers/MSTest.Analyzers.Package/buildTransitive/MSTest.Analyzers.props
  • src/Analyzers/MSTest.Analyzers.Package/buildTransitive/MSTest.Analyzers.targets
  • src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/build/Microsoft.Testing.Extensions.AzureDevOpsReport.props
  • src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/buildMultiTargeting/Microsoft.Testing.Extensions.AzureDevOpsReport.props
  • src/Platform/Microsoft.Testing.Extensions.AzureDevOpsReport/buildTransitive/Microsoft.Testing.Extensions.AzureDevOpsReport.props
  • src/Platform/Microsoft.Testing.Extensions.AzureFoundry/build/Microsoft.Testing.Extensions.AzureFoundry.props
  • src/Platform/Microsoft.Testing.Extensions.AzureFoundry/buildMultiTargeting/Microsoft.Testing.Extensions.AzureFoundry.props
  • src/Platform/Microsoft.Testing.Extensions.AzureFoundry/buildTransitive/Microsoft.Testing.Extensions.AzureFoundry.props
  • src/Platform/Microsoft.Testing.Extensions.CrashDump/build/Microsoft.Testing.Extensions.CrashDump.props
  • src/Platform/Microsoft.Testing.Extensions.CrashDump/buildMultiTargeting/Microsoft.Testing.Extensions.CrashDump.props
  • src/Platform/Microsoft.Testing.Extensions.CrashDump/buildTransitive/Microsoft.Testing.Extensions.CrashDump.props
  • src/Platform/Microsoft.Testing.Extensions.HangDump/build/Microsoft.Testing.Extensions.HangDump.props
  • src/Platform/Microsoft.Testing.Extensions.HangDump/buildMultiTargeting/Microsoft.Testing.Extensions.HangDump.props
  • src/Platform/Microsoft.Testing.Extensions.HangDump/buildTransitive/Microsoft.Testing.Extensions.HangDump.props
  • src/Platform/Microsoft.Testing.Extensions.HotReload/build/Microsoft.Testing.Extensions.HotReload.props
  • src/Platform/Microsoft.Testing.Extensions.HotReload/buildMultiTargeting/Microsoft.Testing.Extensions.HotReload.props
  • src/Platform/Microsoft.Testing.Extensions.HotReload/buildTransitive/Microsoft.Testing.Extensions.HotReload.props
  • src/Platform/Microsoft.Testing.Extensions.HtmlReport/build/Microsoft.Testing.Extensions.HtmlReport.props
  • src/Platform/Microsoft.Testing.Extensions.HtmlReport/buildMultiTargeting/Microsoft.Testing.Extensions.HtmlReport.props
  • src/Platform/Microsoft.Testing.Extensions.HtmlReport/buildTransitive/Microsoft.Testing.Extensions.HtmlReport.props
  • src/Platform/Microsoft.Testing.Extensions.JUnitReport/build/Microsoft.Testing.Extensions.JUnitReport.props
  • src/Platform/Microsoft.Testing.Extensions.JUnitReport/buildMultiTargeting/Microsoft.Testing.Extensions.JUnitReport.props
  • src/Platform/Microsoft.Testing.Extensions.JUnitReport/buildTransitive/Microsoft.Testing.Extensions.JUnitReport.props
  • src/Platform/Microsoft.Testing.Extensions.Retry/build/Microsoft.Testing.Extensions.Retry.props
  • src/Platform/Microsoft.Testing.Extensions.Retry/buildMultiTargeting/Microsoft.Testing.Extensions.Retry.props
  • src/Platform/Microsoft.Testing.Extensions.Retry/buildTransitive/Microsoft.Testing.Extensions.Retry.props
  • src/Platform/Microsoft.Testing.Extensions.Telemetry/build/Microsoft.Testing.Extensions.Telemetry.props
  • src/Platform/Microsoft.Testing.Extensions.Telemetry/buildMultiTargeting/Microsoft.Testing.Extensions.Telemetry.props
  • src/Platform/Microsoft.Testing.Extensions.Telemetry/buildTransitive/Microsoft.Testing.Extensions.Telemetry.props
  • src/Platform/Microsoft.Testing.Extensions.TrxReport/build/Microsoft.Testing.Extensions.TrxReport.props
  • src/Platform/Microsoft.Testing.Extensions.TrxReport/buildMultiTargeting/Microsoft.Testing.Extensions.TrxReport.props
  • src/Platform/Microsoft.Testing.Extensions.TrxReport/buildTransitive/Microsoft.Testing.Extensions.TrxReport.props
  • src/Platform/Microsoft.Testing.Platform.MSBuild/build/Microsoft.Testing.Platform.MSBuild.props
  • src/Platform/Microsoft.Testing.Platform.MSBuild/build/Microsoft.Testing.Platform.MSBuild.targets
  • src/Platform/Microsoft.Testing.Platform.MSBuild/buildMultiTargeting/Microsoft.Testing.Platform.MSBuild.CustomTestTarget.targets
  • src/Platform/Microsoft.Testing.Platform.MSBuild/buildMultiTargeting/Microsoft.Testing.Platform.MSBuild.VSTest.targets
  • src/Platform/Microsoft.Testing.Platform.MSBuild/buildMultiTargeting/Microsoft.Testing.Platform.MSBuild.props
  • src/Platform/Microsoft.Testing.Platform.MSBuild/buildMultiTargeting/Microsoft.Testing.Platform.MSBuild.targets
  • src/Platform/Microsoft.Testing.Platform.MSBuild/buildTransitive/Microsoft.Testing.Platform.MSBuild.props
  • src/Platform/Microsoft.Testing.Platform.MSBuild/buildTransitive/Microsoft.Testing.Platform.MSBuild.targets
  • src/Platform/Microsoft.Testing.Platform/build/Microsoft.Testing.Platform.props
  • src/Platform/Microsoft.Testing.Platform/build/Microsoft.Testing.Platform.targets
  • src/Platform/Microsoft.Testing.Platform/buildMultiTargeting/Microsoft.Testing.Platform.props
  • src/Platform/Microsoft.Testing.Platform/buildMultiTargeting/Microsoft.Testing.Platform.targets
  • src/Platform/Microsoft.Testing.Platform/buildTransitive/Microsoft.Testing.Platform.props
  • src/Platform/Microsoft.Testing.Platform/buildTransitive/Microsoft.Testing.Platform.targets
  • src/TestFramework/TestFramework.Extensions/build/net462/MSTest.TestFramework.targets
  • src/TestFramework/TestFramework.Extensions/build/net8.0/MSTest.TestFramework.targets
  • src/TestFramework/TestFramework.Extensions/build/net9.0/MSTest.TestFramework.targets
  • src/TestFramework/TestFramework.Extensions/build/netstandard2.0/MSTest.TestFramework.targets
  • src/TestFramework/TestFramework.Extensions/build/uap10.0/MSTest.TestFramework.targets
  • src/TestFramework/TestFramework.Extensions/buildTransitive/net8.0AndLater/MSTest.TestFramework.targets
  • src/TestFramework/TestFramework.Extensions/buildTransitive/others/MSTest.TestFramework.targets
  • src/Package/MSTest.Sdk/Sdk/Features/Aspire.targets
  • src/Package/MSTest.Sdk/Sdk/Features/Playwright.targets
  • src/Package/MSTest.Sdk/Sdk/Runner/ClassicEngine.targets
  • src/Package/MSTest.Sdk/Sdk/Runner/Common.targets (findings above)
  • src/Package/MSTest.Sdk/Sdk/Runner/NativeAOT.targets
  • src/Package/MSTest.Sdk/Sdk/VSTest/VSTest.targets
  • Directory.Build.props
  • Directory.Build.targets
  • Directory.Packages.props
  • eng/AfterSolutionBuild.targets
  • eng/Analyzers.props
  • eng/Build.props
  • eng/Publishing.props
  • eng/Tools.props
  • eng/Versions.props
  • eng/common/internal/Directory.Build.props
  • eng/common/native/LocateNativeCompiler.targets
  • samples/public/Directory.Build.props
  • samples/public/Directory.Build.targets
  • samples/public/Directory.Packages.props
  • src/Directory.Build.props
  • src/Platform/Directory.Build.props
  • test/Directory.Build.props
  • test/IntegrationTests/TestAssets/Directory.Build.targets

Reference

This review applies the rule catalog defined in
.github/agents/msbuild-reviewer.agent.md.

Generated by the MSBuild Quality Review scheduled workflow.

πŸ€– Automated content by GitHub Copilot. Posted via a maintainer's GitHub token, so it appears under their account β€” the account owner did not write or approve this content personally. Generated by the MSBuild Quality Review workflow.{ai_credits_suffix} Β· [β—·]( Β· β—·)

  • expires on Jun 18, 2026, 4:36 AM UTC

Metadata

Metadata

Labels

area/mtp-msbuildMTP MSBuild integration.type/automationCreated or maintained by an agentic workflow.type/tech-debtCode health, refactoring, simplification.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions