Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update implicit global namespace support for WPF #4963

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<!--
Generates implicit global namespace imports file <projectname>.ImplicitGlobalNamespaceImports.cs.
-->
<ItemGroup Condition="'$(DisableImplicitNamespaceImports_WPF)' != 'true'
and '$(TargetFrameworkIdentifier)' == '.NETCoreApp'
and $([MSBuild]::VersionGreaterThanOrEquals($(_TargetFrameworkVersionWithoutV), '6.0'))
and '$(UseWPF)' == 'true'">
<Import Remove="System.IO" />
<Import Remove="System.Net.Http" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<DisableImplicitNamespaceImports_WPF Condition="'$(DisableImplicitNamespaceImports_WPF)' == ''
and '$(DisableImplicitNamespaceImports)' != 'true'">false</DisableImplicitNamespaceImports_WPF>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,6 @@
-->
<Import Project="Microsoft.NET.Sdk.WindowsDesktop.WindowsForms.props" />

<Import Project="Microsoft.NET.Sdk.WindowsDesktop.WPF.props" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,17 @@
<NetSdkWarning ResourceName="WindowsDesktopFrameworkRequiresVersion30" />
</Target>

<!-- Import WPF Build logic only when we don't import NETFX's WinFX targets -->
<Import Project="Microsoft.WinFX.targets" Condition="'$(ImportFrameworkWinFXTargets)' != 'true'"/>

<!--
Import Windows Forms targets.
These come via the Windows Forms transport package, that can be found under
https://github.com/dotnet/winforms/tree/main/pkg/Microsoft.Private.Winforms/sdk
-->
<Import Project="Microsoft.NET.Sdk.WindowsDesktop.WindowsForms.targets" Condition="'$(UseWindowsForms)' == 'true'"/>

<!-- Import WPF-specific targets -->
<Import Project="Microsoft.NET.Sdk.WindowsDesktop.WPF.targets" Condition="'$(UseWPF)' == 'true'"/>

<!-- Import WPF Build logic only when we don't import NETFX's WinFX targets -->
<Import Project="Microsoft.WinFX.targets" Condition="'$(ImportFrameworkWinFXTargets)' != 'true'"/>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
<AlwaysCompileMarkupFilesInSeparateDomain Condition="'$(AlwaysCompileMarkupFilesInSeparateDomain)' == '' ">true</AlwaysCompileMarkupFilesInSeparateDomain>
<LocalizationDirectivesToLocFile Condition="'$(LocalizationDirectivesToLocFile)' == ''">None</LocalizationDirectivesToLocFile>

<!-- Disable implicit namespace imports for WPF. This should be removed after support is added in .NET 6.0 rc 1. -->
<DisableImplicitNamespaceImports Condition="'$(DisableImplicitNamespaceImports)' != 'false' and '$(UseWPF)' == 'true'">true</DisableImplicitNamespaceImports>
</PropertyGroup>

<!-- Some Default Settings -->
Expand Down