-
Notifications
You must be signed in to change notification settings - Fork 674
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
WinUI in VS 2019 Preview gives error "... requires WinRT.Runtime.dll version 1.2 or greater" and more #4894
Comments
I just noticed this thread, which reports the same problem: I didnt see it at first, as I was directed to https://github.com/microsoft/microsoft-ui-xaml for any WinUI bugs found. This bug report is in https://github.com/microsoft/ProjectReunion. Thanks. |
Duplicate of microsoft/WindowsAppSDK#740 |
Workaround is to add a global.json in the solution folder: {
"sdk": {
"version": "5.0.202"
}
}
|
Hello, I tried that, and yes, the errors did disappear, but it wont start anyways. Perhaps a new ticket is required, but the error when running it in debug is:
And I found this issue: Where there isnt a fix really, just a workaround |
@tedekeroth you have to create the global.json file first, then create the project (which should create 2 projects). If you create the global.json file after you get that error, only the app project will have been created, not the packaging project which is the one you want to run, which is probably why you're hitting the error. |
in other words: delete the projects that were created, ensure you have an empty folder, add the global.json, then create the solution in that folder which should create 2 projects in that solution. |
You suggest that add the global.json to a folder, then create a solution (.sln) inside that same folder, and then on top of that add the projects? I will try that and report back! |
yes, those are the steps that worked for me |
Alright, that worked in the sense that the Package project was created correctly. I then added the ItemGroup in csproj. It then builds, and looks ok, even though it fails in runtime as stated above. You write that "which is the one you want to run, which is probably why you're hitting the error", indicating I want to run the package project? I read elsewhere that it is not the package project that should be started, but the app project? |
yes, the package project is the one to start, can you try that? |
Yes, that worked. I was very confused from this thread here, where I thought they said that it is not the package project that should be started:
That sounded to me that Packaging shouldn't be run. Apparently, I misread of they said the wrong thing. Thanks for your input asklar =) |
@alwu-msft FYI |
Today I tried to build simple application with WinUI, but it failed. I tried everything as suggested, but it didn't work. Maybe due to change version 0.5.5 to 0.5.6 |
@AghaKhan Did you try the option of adding this block in your .csproj file?
|
@codendone solution worked for me, shame this WinUI3 desktop template is still broken out of the box as of today 6/5/21, not sure why this is closed! |
I didn't code WinUI for some time (I tried it some time ago and worked perfectly fine) and now I wanted to take a tour and surprisingly have the same error but in other version of WinRT.Runtime.dll (this time is 1.6). Can somebody tell me what to do? |
Describe the bug
Unable to build "Blank App, Packaged (WinUI 3 in Desktop)". The error list contains:
I also note that I have yellow triangles in the Dependencies regarding the WinUI, see below.
Steps to reproduce the bug
Expected behavior
I expected the app to build and run, with no apparent errors.
What happened instead
![image](https://user-images.githubusercontent.com/10088477/115998258-b56fdb80-a5e6-11eb-962c-ad0ff013a6d1.png)
In step 5 here: https://docs.microsoft.com/en-us/windows/apps/winui/winui3/get-started-winui3-for-desktop, after clicking OK, I get this error message:
After clicking OK in that error popup, the project loads, and I can see errors in the dependencies:
![image](https://user-images.githubusercontent.com/10088477/115998370-2d3e0600-a5e7-11eb-9c81-1131b740b802.png)
I also note that the "Windows Application Packaging Project" that is supposed to be created (according to the URL above), is not created.
Version Info
WinUI packages version: 0.5.5
Windows app type: desktop
OS: Win 10 20H2 build 19042.928
NuGet package version:
See above.
Windows app type:
Ehm, I am not sure. It says "Output type: Window Application", so I guess Win32?
Additional context
I have used the
maui-check
tool, and that says that everything is OK:The text was updated successfully, but these errors were encountered: