-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
BugProduct bug (most likely)Product bug (most likely)ask-moderank20Rank: Priority/rank on a scale of (1..100)Rank: Priority/rank on a scale of (1..100)regressionstatus: This issue is a regression from a previous build or releasestatus: This issue is a regression from a previous build or release
Milestone
Description
Originally reported by @batzen at https://github.com/dotnet/cli/issues/12267#issuecomment-522067627
- .NET Core Version:
3.0.100-preview9-013744 - Windows version:
10.0.18362.239 - Does the bug reproduce also in WPF for .NET Framework 4.8?: No
Problem description:
A multitargeted WPF project throws an exception when evaluated in MSBuild's "ignore conditions" mode, which is often used in design-time scenarios.
This is because while the conditions here are sufficient at build time for real projects, when conditions are ignored MSBuild thinks the project is invalid (dotnet/msbuild#4622)
wpf/packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props
Lines 98 to 121 in d6c7ae5
| <ItemGroup Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') And ('$(_TargetFrameworkVersionWithoutV)' != '') And | |
| ('$(_TargetFrameworkVersionWithoutV)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> | |
| <!-- | |
| The following 3 _WpfCommonNetFxReference items normally require Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'", since | |
| they are supported on .NET Framework 3.0 and above. | |
| This condition is implicitly satisfied by '$(_TargetFrameworkVersionWithoutV)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)' | |
| in the outer ItemGroup | |
| --> | |
| <_WpfCommonNetFxReference Include="WindowsBase" /> | |
| <_WpfCommonNetFxReference Include="PresentationCore" /> | |
| <_WpfCommonNetFxReference Include="PresentationFramework" /> | |
| <_WpfCommonNetFxReference Include="System.Xaml" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.0'"> | |
| <RequiredTargetFramework>4.0</RequiredTargetFramework> | |
| </_WpfCommonNetFxReference> | |
| <_WpfCommonNetFxReference Include="UIAutomationClient" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.0'" /> | |
| <_WpfCommonNetFxReference Include="UIAutomationClientSideProviders" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.0'" /> | |
| <_WpfCommonNetFxReference Include="UIAutomationProvider" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.0'" /> | |
| <_WpfCommonNetFxReference Include="UIAutomationTypes" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.0'" /> | |
| <_WpfCommonNetFxReference Include="System.Windows.Controls.Ribbon" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.5'" /> | |
| </ItemGroup> |
Actual behavior:
error: A numeric comparison was attempted on "$(_TargetFrameworkVersionWithoutV)" that evaluates to "" instead of a number, in condition "'$(_TargetFrameworkVersionWithoutV)' >= '4.5'". c:\program files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.NET.Sdk.WindowsDesktop.props
Expected behavior:
No error
Minimal repro:
- dotnet new wpf
- Replace
TargetFrameworkwith<TargetFrameworks>netcoreapp3.0;net45</TargetFrameworks> - dotnet restore
- dotnet list package
Metadata
Metadata
Assignees
Labels
BugProduct bug (most likely)Product bug (most likely)ask-moderank20Rank: Priority/rank on a scale of (1..100)Rank: Priority/rank on a scale of (1..100)regressionstatus: This issue is a regression from a previous build or releasestatus: This issue is a regression from a previous build or release