-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Conversation
Tagging subscribers to this area: @ViktorHofer |
src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj
Outdated
Show resolved
Hide resolved
<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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'))
?
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
@ericstj @ViktorHofer can i go ahead and merge this one ? |
...ies/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj
Show resolved
Hide resolved
i verified that intellisense is still working |
@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> |
There was a problem hiding this comment.
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.
src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj
Show resolved
Hide resolved
<NuGetDeploySourceItem>Reference</NuGetDeploySourceItem> | ||
<TargetsNetStandardLowerThan21 Condition="'$(TargetsNetStandard)' == 'true' and '$(NETStandardVersion)' < 2.1">true</TargetsNetStandardLowerThan21> | ||
<TargetsNetStandardLowerThan21 Condition="$(TargetFramework.StartsWith('netstandard')) and '$(NETStandardVersion)' < 2.1">true</TargetsNetStandardLowerThan21> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
i will address the remaining comments in the follow up pr. |
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