Skip to content

Conversation

Copy link

Copilot AI commented Aug 6, 2025

This PR introduces the ImplicitMSTestUsings property to control MSTest implicit usings and adds ImplicitUsings configuration to all test asset projects for consistency.

Problem

Following issue #3 which introduced the ImplicitMSTestUsings property, many test asset projects in test/IntegrationTests/TestAssets/ were missing the ImplicitUsings configuration. This created inconsistency across the test suite where:

  • The root Directory.Build.props has <ImplicitUsings>enable</ImplicitUsings> globally
  • Only 1 out of 29 test asset projects had explicit ImplicitUsings configuration
  • 28 test asset projects were missing this setting entirely

Solution

This PR includes two main components:

  1. ImplicitMSTestUsings Property Support: Modified target files to add support for the ImplicitMSTestUsings property, allowing users to control whether MSTest namespaces are implicitly included when ImplicitUsings is enabled. The property defaults to enabled when not specified.

  2. Test Asset Configuration: Added <ImplicitUsings>enable</ImplicitUsings> to all 28 test asset projects that were missing this configuration.

Changes Made

  • Modified 3 target files to add ImplicitMSTestUsings property support:
    • src/Package/MSTest.Sdk/Sdk/VSTest/VSTest.targets
    • src/TestFramework/TestFramework.Extensions/buildTransitive/net8.0AndLater/MSTest.TestFramework.targets
    • src/TestFramework/TestFramework.Extensions/buildTransitive/others/MSTest.TestFramework.targets
  • Added 5 test methods to SdkTests.cs to verify the ImplicitMSTestUsings functionality with different settings
  • Added exactly one line (<ImplicitUsings>enable</ImplicitUsings>) to 28 test asset project files
  • Maintained existing PropertyGroup structure and ordering
  • All 29 test asset projects now have consistent ImplicitUsings configuration

The changes ensure:

  • Consistent configuration across all test assets
  • Proper implicit using behavior for MSTest namespaces
  • Users can opt-out of MSTest implicit usings by setting <ImplicitMSTestUsings>false</ImplicitMSTestUsings> or <ImplicitMSTestUsings>disable</ImplicitMSTestUsings>
  • Alignment with the global build configuration

Fixes #4.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI added 2 commits August 5, 2025 23:33
The addition of this namespace to Implicit Usings is causing us problems because we make use of the System.ComponentModel.DescriptionAttribute in more places.

* Add ImplicitMSTestUsings property to control MSTest implicit usings
* Add comprehensive tests for ImplicitMSTestUsings property
Copilot AI and others added 4 commits August 6, 2025 00:29
Co-authored-by: MatthewSteeples <255971+MatthewSteeples@users.noreply.github.com>
Co-authored-by: MatthewSteeples <255971+MatthewSteeples@users.noreply.github.com>
Co-authored-by: MatthewSteeples <255971+MatthewSteeples@users.noreply.github.com>
Co-authored-by: MatthewSteeples <255971+MatthewSteeples@users.noreply.github.com>
Copilot AI changed the title [WIP] Tests are incomplete Add ImplicitUsings to test asset projects for consistent configuration Aug 6, 2025
Copilot AI requested a review from MatthewSteeples August 6, 2025 00:38
@MatthewSteeples
Copy link
Member

@copilot Can you rebase this branch?

Copy link
Author

Copilot AI commented Oct 12, 2025

@copilot Can you rebase this branch?

I'm unable to rebase this branch as I don't have the capability to perform git rebase operations (force push is not available in my environment). The branch needs to be rebased onto the latest main branch which is 4831 commits ahead.

Could you perform the rebase yourself, or would you like me to recreate the changes on top of the current main branch instead?

@MatthewSteeples
Copy link
Member

@copilot recreate the changes please

Copy link
Author

Copilot AI commented Oct 12, 2025

@copilot recreate the changes please

Changes recreated successfully on top of the latest main branch in commit 3bacd356d.

The following changes were applied:

  • Modified 3 target files to add ImplicitMSTestUsings property support
  • Added 5 new test methods to verify the ImplicitMSTestUsings functionality
  • Added <ImplicitUsings>enable</ImplicitUsings> to 28 test asset project files

All changes are now based on the current main branch (commit 1b35aad).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 0t3vsblobprodcus362.vsblob.vsassets.io
    • Triggering command: /home/REDACTED/work/testfx/testfx/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/testfx/testfx/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/testfx/testfx/artifacts/toolset/11.0.0-beta.25509.1.txt (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add ImplicitUsings to test asset projects for consistent configuration Add ImplicitMSTestUsings property and ImplicitUsings to test asset projects Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests are incomplete

2 participants