Open zydjohnHotmail opened 6 days ago
One possible problem is that the Windows App SDK requires you to target a Windows 10 version >= 10.0.17763.0. This doesn't get set with a .NET application. For now, the easiest way to fix the project is to open the .csproj file and add the version to the TargetFramework element. As an example, from:
to:
Note the addition of the version number. This should allow you to get the project you are working on back up and running.
The current way to add the Windows App SDK to the project first requires that you set the Target OS version in the project properties.
This adds the version number to the TargetFramework element. You need to do this before you add the Windows App SDK NuGet package.
You would expect that the target version be set to an appropriate value though.
Hello: I have tried my best to understand your instruction and install it again, but no luck. I have done the following, and maybe combine some actions:
But I always got the same errors, total 7 errors.
You can see the screenshot.
At least I have to say that for this Nuget package, it is very very user not friendly.
Unless you are the member in the team who develop this package, who may know how to use this. But ask your colleagues in Microsoft, even they are developers, and may want to use this Nuget package, do you think they can figure this out.
But my experience shows that your advice did NOT work yet.
Please advise what I can do to get this installed?
Please refer to the screen shots for details>
Best Regards,
Ironically, seeing those errors means that you got it to work. The Windows App SDK NuGet is in and working. Congratulations. What you are seeing now is something missing from your project file. I didn't think to mention this earlier, since I was only thinking about getting the package to install for you.
Anyway, you also need to set the runtime identifiers for any platform that you are targetting.
With this set, it will still warn about a version specific RID, but that is a known issue.
Hi, If I can install this nuget package even see 7 errors, as you said if installation is ironically successful, but how can build the project? Whenever I have those 7 errors, I can't build the project. Please advise either how to build the project with 7 errors or how to fix those 7 errors, even those errors are not directly caused by this nuget package?
I already told you, look at the screenshot. This allows the project to build successfully with a single warning.
Hi, I tried again according to your advice, here is my current .csproj file:
I hope my .csproj file is correct. But when I built my project, I still got the same 7 errors. Please see the screenshot.
Let me know if I missed anything.
Thanks,
Look at my screenshot again, carefully.
It has <RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
. Notice the plural.
Above is a project that is set up to use the Windows App SDK.
Hi, Thanks for your reply, I finally got this installed. However, what I want to use this nuget pacakge in WinForm app project is I found maybe I can use new library to do OCR job, refer to this article: Text Recognition in the Windows App SDK (Url: https://learn.microsoft.com/en-us/windows/ai/apis/text-recognition) But this article indicate that I need a NPU and write C++ code to do job, since NPU is very new device, I don't have this yet, and I don't believe most of the people have this nowadays. And since my knowledge for C++ is also very limited. But I want to know if I can use this Nuget package running in my C# WinForm project to do the same OCR job as described in the article without a NPU hardware and without writting C++ code, I can write C# code in my Windows 10 PC without a NPU. Please advise, Thanks,
Describe the bug
Hi, I want to create one WinForms app project using Visual Studio 2022 (Version 17.10.3) and use Nuget Microsoft.WindowsAppSDK to do some OCR tests, but as long as I installed the Nuget Microsoft.WindowsAppSDK current version, I saw the error, and the whole project is not able to open again normally. If you open the project, it is no long a WinForms app project, all the items in the original project are unloaded.
Steps to reproduce the bug
Expected behavior
The nuget package Microsoft.WindowsAppSDK -Version 1.5.240607001 should be installed without any of such issue, and users should be able to write code to use this package to do some OCR jobs.
Screenshots
See the screenshot for the error:![InstallMicrosoft WindowsAppSDKNOK](https://github.com/microsoft/WindowsAppSDK/assets/45263518/e958f1a4-ccd3-4583-ab6a-544475d56717)
NuGet package version
Windows App SDK 1.5.4: 1.5.240607001
Packaging type
Unpackaged
Windows version
Windows 10 version 22H2 (19045, 2022 Update)
IDE
Visual Studio 2022
Additional context
Hi, since the font of the error message is too small, so I have to use some free online tools to do "OCR" to show you the error message. (: The following is the error messages in text: @ The project ‘MicrosoftAlOCRForm' ran into a problem during the last operation: A numeric comparison was attempted on "$(TargetPlatformVersion)" that evaluates to“ instead of a number, in condition "'$(TargetPlatformldentifier)’ == Windows’ and ‘$(TargetPlatformVersion)' >= '8.0"". C:\Users\ohn.nuget\packages\microsoft.windowsappsdk\1.5.240607001\ build Transitive\ Microsoft.UI.Xaml.Markup.Compiler.interop.targets You may need to reload the solution after fixing the problem. No response