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

installing WindowsAppSDK can lead to project errors #3952

Closed
vsfeedback opened this issue Nov 9, 2023 · 6 comments
Closed

installing WindowsAppSDK can lead to project errors #3952

vsfeedback opened this issue Nov 9, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It’s more difficult to complete my work]
Create a console app
Install nuget package WindowsAppSDK

You will get a brown error:

The project ‘myproject’ ran into a problem during the last operation: A numeric comparison was attempted on “$(TargetPlatformVersion)” that evaluates to “” instead of a number, in condition “‘$(TargetPlatformVersion)’ < ‘10.0.18362.0’”. C:\Users\username.nuget\packages\microsoft.windowsappsdk\1.3.230724000\buildTransitive\Microsoft.InteractiveExperiences.Common.targets You may need to reload the solution after fixing the problem.

And also an error while loading the project properties editor

Screenshot 2023-08-02 184451.png

Setting the following does not help…

net7.0-windows

That just generates a new error…

The project ‘myproject’ ran into a problem during the last operation: A numeric comparison was attempted on “$(TargetPlatformVersion)” that evaluates to “” instead of a number, in condition “‘$(TargetPlatformIdentifier)’ == ‘Windows’ and
‘$(TargetPlatformVersion)’ >= ‘8.0’”. C:\Users\usernam.nuget\packages\microsoft.windowsappsdk\1.3.230724000\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets You may need to reload the solution after fixing the problem.

This is all a bad experience. And it’s not clear what I need to do when this happens other than search online for xaml code (or look in another project I have going) that might help the situation and manually insert it. I think this is configuration that could be automated generally.

I don’t see the solution on any of these pages…

https://learn.microsoft.com/en-us/visualstudio/ide/how-to-configure-projects-to-target-platforms?view=vs-2022
https://learn.microsoft.com/en-us/dotnet/standard/frameworks


Original Comments

Feedback Bot on 8/2/2023, 02:18 AM:

(private comment, text removed)

Zhengye Xu [MSFT] on 8/2/2023, 08:34 PM:

(private comment, text removed)

Zhengye Xu [MSFT] on 8/8/2023, 07:54 PM:

(private comment, text removed)

Zhengye Xu [MSFT] on 8/10/2023, 08:21 PM:

(private comment, text removed)

Gavin Williams on 8/10/2023, 09:37 PM:

(private comment, text removed)

Zhengye Xu [MSFT] on 8/11/2023, 00:11 AM:

(private comment, text removed)

Gavin Williams on 8/13/2023, 06:59 PM:

(private comment, text removed)

Zhengye Xu [MSFT] on 8/14/2023, 06:17 PM:

(private comment, text removed)

Feedback Bot on 11/2/2023, 01:37 AM:

(private comment, text removed)

Feedback Bot on 11/7/2023, 07:02 PM:

(private comment, text removed)


Original Solutions

(no solutions)

@MSLukeWest
Copy link
Contributor

Can the targets be updated to avoid this comparison when TargetPlatformVersion isn't set?

@duncanmacmichael duncanmacmichael added the bug Something isn't working label Nov 9, 2023
@kmgallahan
Copy link

kmgallahan commented Nov 10, 2023

Create a console app
Install nuget package WindowsAppSDK

@duncanmacmichael Wrong repo:

https://github.com/microsoft/WindowsAppSDK

@MSLukeWest
Copy link
Contributor

Looks like this has been known for a while, see #2338

@codendone codendone transferred this issue from microsoft/microsoft-ui-xaml Nov 11, 2023
@bpulliam
Copy link
Collaborator

Closing as Duplicate given Luke's comments.

@bpulliam bpulliam closed this as not planned Won't fix, can't repro, duplicate, stale Nov 16, 2023
@ramiz272
Copy link

ramiz272 commented Jul 1, 2024

replace this line in file : C:\Users\username.nuget\packages\microsoft.windowsappsdk\1.3.230724000\buildTransitive\Microsoft.InteractiveExperiences.Common.target

Line to replace:
<Ixp-UAPTargetVersion Condition="'$(TargetPlatformVersion)' &lt; '10.0.18362.0'">uap10.0.17763</Ixp-UAPTargetVersion>
TO:
<Ixp-UAPTargetVersion Condition=" '$(TargetPlatformVersion)' != '' And '$(TargetPlatformVersion)' &lt; '10.0.18362.0'">uap10.0.17763</Ixp-UAPTargetVersion>

WILL RESOLVE THIS ISSUE :)

@Scottj1s
Copy link
Member

Looks like this has been known for a while, see #2338

This issue identified here and (originally) in #2338 is fixed in Windows App SDK 1.5.240428000 and later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants