Skip to content

Commit cb9a032

Browse files
committed
Update import of implicit usings
Relates to dotnet/sdk#19521 Relates to dotnet/sdk#19599
1 parent 386615f commit cb9a032

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

pkg/Microsoft.Private.Winforms/sdk/dotnet-wpf/Microsoft.NET.Sdk.WindowsDesktop.WindowsForms.props

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,13 @@
1212
Generates implicit namespace imports source to intermediate directory for Windows Forms projects
1313
============================================================
1414
-->
15-
<ItemGroup Condition="'$(DisableImplicitNamespaceImports_WindowsForms)' != 'true'
16-
and '$(TargetFrameworkIdentifier)' == '.NETCoreApp'
17-
and $([MSBuild]::VersionGreaterThanOrEquals($(_TargetFrameworkVersionWithoutV), '6.0'))
18-
and '$(UseWindowsForms)' == 'true'">
19-
<Import Include="System" />
20-
<Import Include="System.Collections.Generic" />
21-
<Import Include="System.IO" />
22-
<Import Include="System.Linq" />
23-
<Import Include="System.Drawing" />
24-
<Import Include="System.Windows.Forms" />
15+
<ItemGroup Condition="'$(UseWindowsForms)' == 'true' and ('$(ImplicitUsings)' == 'true' or '$(ImplicitUsings)' == 'enable')">
16+
<Using Include="System" />
17+
<Using Include="System.Collections.Generic" />
18+
<Using Include="System.IO" />
19+
<Using Include="System.Linq" />
20+
<Using Include="System.Drawing" />
21+
<Using Include="System.Windows.Forms" />
2522
</ItemGroup>
2623

2724
<!-- Windows Forms source generator and analyzers -->

pkg/Microsoft.Private.Winforms/sdk/dotnet-wpf/Microsoft.NET.Sdk.WindowsDesktop.WindowsForms.targets

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,5 @@
66
-->
77

88
<Project>
9-
<!--
10-
============================================================
11-
GenerateImplicitNamespaceImports
12-
Controls the implicit namespace imports for Windows Forms projects
13-
============================================================
14-
-->
15-
<PropertyGroup>
16-
<DisableImplicitNamespaceImports_WindowsForms
17-
Condition="'$(DisableImplicitNamespaceImports_WindowsForms)' == ''
18-
and '$(DisableImplicitNamespaceImports)' != 'true'">false</DisableImplicitNamespaceImports_WindowsForms>
19-
</PropertyGroup>
209

2110
</Project>

0 commit comments

Comments
 (0)