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

Remove Targets* instances from .props files #35353

Merged
merged 16 commits into from
Apr 28, 2020
Merged

Remove Targets* instances from .props files #35353

merged 16 commits into from
Apr 28, 2020

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Apr 23, 2020

Fixes #35317

We need to remove all occurences of TargetsNetfx, TargetsNetcoreApp and TargetsNetstandard from the props and csproj file
This issue removes them from isPartialFacadeAssemblyProperty

@ghost
Copy link

ghost commented Apr 23, 2020

Tagging subscribers to this area: @ViktorHofer
Notify danmosemsft if you want to be subscribed.

<TargetFrameworks>netstandard2.0-Windows_NT;net461-Windows_NT;netstandard2.0;$(NetFrameworkCurrent)-Windows_NT</TargetFrameworks>
<ExcludeCurrentFullFrameworkFromPackage>true</ExcludeCurrentFullFrameworkFromPackage>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="$(TargetFramework.StartsWith('netstandard')) and '$(TargetsWindows)' != 'true'">SR.PlatformNotSupported_AccessControl</GeneratePlatformNotSupportedAssemblyMessage>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can’t use TargetsWindows here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently we cant entirely remove TargetsWindows and just depend on TargetFramework due to nuget restrictions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you do $(TargetFramework.EndsWith('Windows_NT'))?

Copy link
Contributor Author

@Anipik Anipik Apr 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no we remove Windows_NT in sdk.props. we need to do this to include nuget generated props and targets file

<PropertyGroup>
<IsPartialFacadeAssembly Condition="$(TargetFramework.StartsWith('net4'))">true</IsPartialFacadeAssembly>
<OmitResources Condition="$(TargetFramework.StartsWith('net4'))">true</OmitResources>
<GeneratePlatformNotSupportedAssemblyMessage Condition="$(TargetFramework.StartsWith('netstandard')) and '$(TargetsWindows)' != 'true'">SR.PlatformNotSupported_ServiceController</GeneratePlatformNotSupportedAssemblyMessage>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can’t use TargetsWindows here

<NoWarn Condition="'$(TargetsUnix)' == 'true'">$(NoWarn);CA1823</NoWarn> <!-- Avoid unused fields warnings in Unix build -->
<TargetFrameworks>$(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetFrameworkCurrent)-Windows_NT;netstandard2.0-Windows_NT;netstandard2.0-Unix;netstandard2.0;net461-Windows_NT</TargetFrameworks>
<ExcludeCurrentNetCoreAppFromPackage>true</ExcludeCurrentNetCoreAppFromPackage>
<ExcludeCurrentFullFrameworkFromPackage>true</ExcludeCurrentFullFrameworkFromPackage>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<IsPartialFacadeAssembly Condition="$(TargetFramework.StartsWith('net4'))">true</IsPartialFacadeAssembly>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetsAnyOS)' == 'true' and $(TargetFramework.StartsWith('netstandard'))">SR.PlatformNotSupported_Registry</GeneratePlatformNotSupportedAssemblyMessage>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can’t use TargetsAnyOS here

@Anipik
Copy link
Contributor Author

Anipik commented Apr 27, 2020

@ericstj @ViktorHofer can i go ahead and merge this one ?

@Anipik Anipik changed the title Remove TargetsNetfx Containing isPartialFacadeAssembly properties Remove Targets* instances from .props files Apr 27, 2020
@ViktorHofer ViktorHofer removed the request for review from ahsonkhan April 27, 2020 20:43
@Anipik
Copy link
Contributor Author

Anipik commented Apr 27, 2020

i verified that intellisense is still working

@Anipik
Copy link
Contributor Author

Anipik commented Apr 28, 2020

@ericstj @ViktorHofer @safern any comments ?

<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<GeneratePlatformNotSupportedAssemblyMessage Condition="$(TargetFramework.StartsWith('netstandard'))">SR.PlatformNotSupported_ComponentModel_Composition</GeneratePlatformNotSupportedAssemblyMessage>
<NoWarn Condition="!$(TargetFramework.StartsWith('netcoreapp')) or '$(TargetFramework)' == 'netcoreapp2.0'">$(NoWarn);nullable</NoWarn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if you could do these checks in a way that doesn't break the tfm change which is scheduled for Monday: #35176.

<NuGetDeploySourceItem>Reference</NuGetDeploySourceItem>
<TargetsNetStandardLowerThan21 Condition="'$(TargetsNetStandard)' == 'true' and '$(NETStandardVersion)' &lt; 2.1">true</TargetsNetStandardLowerThan21>
<TargetsNetStandardLowerThan21 Condition="$(TargetFramework.StartsWith('netstandard')) and '$(NETStandardVersion)' &lt; 2.1">true</TargetsNetStandardLowerThan21>
Copy link
Member

@ViktorHofer ViktorHofer Apr 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to move these into a second property group as well? same for the netstandard.depproj below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont run the design time build for deprojs

@Anipik
Copy link
Contributor Author

Anipik commented Apr 28, 2020

i will address the remaining comments in the follow up pr.

@Anipik Anipik merged commit 4c4b263 into dotnet:master Apr 28, 2020
@Anipik Anipik deleted the partialFacade branch April 28, 2020 20:36
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing List of props that indirectly\directly derives from targetFramework.
5 participants