Open dhoehna opened 2 years ago
Yup, I run into this brick wall a lot, to the point where I learned to check TFM when strange things start happening. When this occurs you typically lose access to the project file editing experience too, making it very difficult to quickly fix. Generally Visual Studio requires a restart once in this state.
This issue is still very much present, but can be aggravated in cross-targeted projects by the NuGet package manager not supporting conditional ItemGroups properly: https://developercommunity.visualstudio.com/t/NuGet-Package-manager-does-not-honor-con/10269291
@manodasanW There's been another instance of this, see https://developercommunity.visualstudio.com/t/installing-WindowsAppSDK-can-lead-to-pro/10429073
Can the targets be updated to avoid this comparison when TargetPlatformVersion isn't set?
This is still an issue when converting from net7.0 to net8.0 in Uno projects, viz
A numeric comparison was attempted on "$(TargetPlatformVersion)" that evaluates to "" instead of a number, in condition "'$(TargetPlatformIdentifier)' == 'Windows' and
'$(TargetPlatformVersion)' >= '8.0'". C:\Users\Daisy\.nuget\packages\microsoft.windowsappsdk\1.5.240607001\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets
replace this line in file : C:\Users\dahoehna.nuget\packages\microsoft.windowsappsdk\1.1.0-preview1\buildTransitive\Microsoft.InteractiveExperiences.Common.targets
Line to replace:
<Ixp-UAPTargetVersion Condition="'$(TargetPlatformVersion)' < '10.0.18362.0'">uap10.0.17763</Ixp-UAPTargetVersion>
TO:
<Ixp-UAPTargetVersion Condition=" '$(TargetPlatformVersion)' != '' And '$(TargetPlatformVersion)' < '10.0.18362.0'">uap10.0.17763</Ixp-UAPTargetVersion>
WILL RESOLVE THIS ISSUE :)
This is still an issue when converting from net7.0 to net8.0 in Uno projects, viz
A numeric comparison was attempted on "$(TargetPlatformVersion)" that evaluates to "" instead of a number, in condition "'$(TargetPlatformIdentifier)' == 'Windows' and '$(TargetPlatformVersion)' >= '8.0'". C:\Users\Daisy\.nuget\packages\microsoft.windowsappsdk\1.5.240607001\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets
replace this line in file : C:\Users\Daisy.nuget\packages\microsoft.windowsappsdk\1.5.240607001\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets
Line to replace:
<Ixp-UAPTargetVersion Condition="'$(TargetPlatformVersion)' < '10.0.18362.0'">uap10.0.17763</Ixp-UAPTargetVersion>
TO:
<Ixp-UAPTargetVersion Condition=" '$(TargetPlatformVersion)' != '' And '$(TargetPlatformVersion)' < '10.0.18362.0'">uap10.0.17763</Ixp-UAPTargetVersion>
WILL RESOLVE THIS ISSUE :)
Describe the bug
Adding Windows App SDK 1.1-Preview 1 to a .NET projects causes the project build to fail, saying that "Target Framework is empty". Specifically: A numeric comparison was attempted on "$(TargetPlatformVersion)" that evaluates to "" instead of a number, in condition "'$(TargetPlatformVersion)' < '10.0.18362.0'". C:\Users\dahoehna.nuget\packages\microsoft.windowsappsdk\1.1.0-preview1\buildTransitive\Microsoft.InteractiveExperiences.Common.targets
Steps to reproduce the bug
Expected behavior
A message in the build output asking to add the windows version to the "TargetFramework" attribute in the csproj.
Screenshots
No response
NuGet package version
No response
Packaging type
Unpackaged
Windows version
No response
IDE
Visual Studio 2022
Additional context
There is currently a workaround by adding the version manually.
Changenet6.0 to net6.0-windows10.0.19041.0