You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add ImplicitMSTestUsings property to control MSTest implicit usings
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
Copy file name to clipboardExpand all lines: src/Package/MSTest.Sdk/Sdk/VSTest/VSTest.targets
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@
31
31
Ensure feature is available and user hasn't opted-out from it.
32
32
See https://github.com/dotnet/sdk/blob/f9fdf2c7d94bc86dc443e5a9ffecbd1962b1d85d/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.CSharp.props#L26-L34
33
33
-->
34
-
<ItemGroupCondition="'$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable'">
34
+
<ItemGroupCondition="('$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable') And ('$(ImplicitMSTestUsings)' == '' Or '$(ImplicitMSTestUsings)' == 'true' Or '$(ImplicitMSTestUsings)' == 'enable')">
Copy file name to clipboardExpand all lines: src/TestFramework/TestFramework.Extensions/buildTransitive/net6.0AndLater/MSTest.TestFramework.targets
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@
25
25
Ensure feature is available and user hasn't opted-out from it.
26
26
See https://github.com/dotnet/sdk/blob/f9fdf2c7d94bc86dc443e5a9ffecbd1962b1d85d/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.CSharp.props#L26-L34
27
27
-->
28
-
<ItemGroupCondition="'$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable'">
28
+
<ItemGroupCondition="('$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable') And ('$(ImplicitMSTestUsings)' == '' Or '$(ImplicitMSTestUsings)' == 'true' Or '$(ImplicitMSTestUsings)' == 'enable')">
Copy file name to clipboardExpand all lines: src/TestFramework/TestFramework.Extensions/buildTransitive/others/MSTest.TestFramework.targets
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
Ensure feature is available and user hasn't opted-out from it.
6
6
See https://github.com/dotnet/sdk/blob/f9fdf2c7d94bc86dc443e5a9ffecbd1962b1d85d/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.CSharp.props#L26-L34
7
7
-->
8
-
<ItemGroupCondition="'$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable'">
8
+
<ItemGroupCondition="('$(ImplicitUsings)' == 'true' Or '$(ImplicitUsings)' == 'enable') And ('$(ImplicitMSTestUsings)' == '' Or '$(ImplicitMSTestUsings)' == 'true' Or '$(ImplicitMSTestUsings)' == 'enable')">
.PatchCodeWithReplace("using Microsoft.VisualStudio.TestTools.UnitTesting;","// Explicit using removed to test implicit usings"));
478
+
479
+
// When ImplicitMSTestUsings is enabled, the compilation should succeed because Microsoft.VisualStudio.TestTools.UnitTesting should be implicitly available
.PatchCodeWithReplace("using Microsoft.VisualStudio.TestTools.UnitTesting;","// Explicit using removed to test implicit usings"));
531
+
532
+
// When ImplicitMSTestUsings is set to 'enable', the compilation should succeed because Microsoft.VisualStudio.TestTools.UnitTesting should be implicitly available
0 commit comments