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

Attempting to open Package.appxmanifest in the latest Uno Platform project in Visual Studio results in an error, as does attempting to change the file's “Generate Action” property. #19486

Open
Starcloudsea opened this issue Feb 8, 2025 · 16 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@Starcloudsea
Copy link

Starcloudsea commented Feb 8, 2025

Current behavior

In any Uno Platform Application project, when trying to open the Package.appxmanifest file, it throws an error:
Image

and an error occurs when trying to change the file's “Generate Action” property:
Image
(This issue is only reproduced successfully for image files.)

This issue has been reproduced in both physical and sandbox environments.

Expected behavior

When trying to open the Package.appxmanifest file, the file should open normally.

When trying to change the “Generate Action” property of an image file, the property is successfully applied without error.

How to reproduce it (as minimally and precisely as possible)

The problem can be reproduced by simply creating a new Uno Platform Application project, double-clicking on the Package.appxmanifest file or changing the “Generate Action” property of the image file.

I used this command to create the project in the testbed:

dotnet new unoapp -o TestApp -platforms "maccatalyst" -platforms "windows" -platforms "desktop" -ci "github" -presentation "mvvm" -di  -log "serilog" -tests "unit" -theme-service  -pub "TestApp"

And, I installed an additional Visual Studio Builder 2022 (with the “C++ Desktop Development” workload checked).

Workaround

No response

Works on UWP/WinUI

No

Environment

Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia

NuGet package version(s)

Uno.WinUI: 5.6.30

Affected platforms

Windows (WinAppSDK)

IDE

Visual Studio 2022

IDE version

17.12.4

Relevant plugins

Uno Platform:5.6.15.19

Anything else we need to know?

1, Visual Studio Builder 2022 is installed on both test platforms (with “Desktop development in C++” checked).

2, I think someone mentioned a similar issue and it was fixed, but it still occurs in the new version:
https://developercommunity.visualstudio.com/t/Double-clicking-on-a-PackageAppxmanifes/10658683

3, you can use the code from my repository to assist in fixing the bug, but note that you must switch to the Backup branch:
https://github.com/BadBC-Studio/BadMC_Launcher/tree/Backup

4, only Uno Platform projects have this problem and it is certain that it is not a Visual Studio corruption, as I tried deleting all the files and reinstalling the system in order to fix the two bugs, but the problem still occurs, but projects using the Windows App SDK don't have these two bugs.

5, I participated in this bug feedback because I encountered the same problem as him:
https://developercommunity.visualstudio.com/t/Error-HRESULT-e_fail-has-been-returned/10819926
I hope what's in here will help you guys to solve this bug.

6, The issue uses translation software to translate it into English, which may contain grammatical errors.

I hope Uno Platform can solve these two bugs, they cause me to not be able to debug WinAppSDK (Packaged) and not be able to apply image file generation operations correctly, thanks!🤗

Addendum: It looks like the bug has nothing to do with Visual Studio Generator Tool 2022, because I tried opening a new sandbox and installing only Visual Studio, and the bug is still there.

And a picture that might be useful:
Image

@Starcloudsea Starcloudsea added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Feb 8, 2025
@Mike-E-angelo
Copy link

Related discussion: #19484

@DevTKSS
Copy link
Contributor

DevTKSS commented Feb 9, 2025

@Mike-E-angelo to enhance the count of ones who can help, would you please try to set your environment to english language and repost the screenshots? I can for example not a single word in sign language as this but from the file package.appxmanifest you are mentioning and the issue you are having as far as I do understand to have something to do with opening that file, I might had this myself and if I am correct suggesting maybe having a ... lets say at lest workaround for you there. But to verify thats what I am suggesting to be your issue, please share that in english language.
Thanks!

@Starcloudsea
Copy link
Author

Absolutely, please give me some time to download the language pack.

@Mike-E-angelo
Copy link

@DevTKSS to be certain I am not the author of this issue, but @Starcloudsea is and they were also on the Developer Community ticket as well. :) 👍

@Starcloudsea
Copy link
Author

@Mike-E-angelo to enhance the count of ones who can help, would you please try to set your environment to english language and repost the screenshots? I can for example not a single word in sign language as this but from the file package.appxmanifest you are mentioning and the issue you are having as far as I do understand to have something to do with opening that file, I might had this myself and if I am correct suggesting maybe having a ... lets say at lest workaround for you there. But to verify thats what I am suggesting to be your issue, please share that in english language. Thanks!

Hi, here's the new screenshot:

Image

Image

Thank you for your help.😀

@DevTKSS
Copy link
Contributor

DevTKSS commented Feb 9, 2025

hm other issue okay. thought it was an other one...

@Mike-E-angelo
Copy link

For further clarity, this is the Uno Platform equivalent of the already-reported developercommunity issue, which was originally reported as a Visual Studio issue. There was some discussion about whether this was a Visual Studio or Uno Platform issue. So both systems now have a created issue to determine the root cause.

That is my understanding of these two issues at present.

@DevTKSS
Copy link
Contributor

DevTKSS commented Feb 10, 2025

The reason I was thinking of it might be same issue, is:
First time I used uno I was also not able to open this file. It was opt 1 opening that designer unusable in my opinion for uno projects e.g.
Opt 2 telling it could not open this file, but that has been in November last year so i dont remember the error message.

What I did to resolve it for me:

  1. Right click on this file
  2. Open with... "XML(Text)-Editor" instead of App-Manifest-Designer

! Not the one with "with coding"(in german its named "wmit Codierung") that has not been working!

Set this one to be standard and never had any issues again with this => I could double click and open it as much as I like, working as it should do.

Maybe someone of you who is having this issue from above would like to check this steps?

@DevTKSS
Copy link
Contributor

DevTKSS commented Feb 10, 2025

@jeromelaban
I do not find that discussion/issue again I did to that file at this past time, but I asked about the possibility of changing the default content of this file for uno projects or add the minimal required contents by the wizard which might help with some warnings on building to win target also I seen that past time, telling some properties are not filled as it liked them to be.

Is there some answer/possibility to update this files? I researched in the uno.templates and uno.sdk repos but did not find the files we are getting on e.g. recommended or this file mentioned here.

Edit: Additional Information to this solution idea:
compared Uno Package.appxmanifest and the one coming from the WinUI3 in VS 2022

WinUIManifestfile.zip

UnoManifestfile.zip
the WinUI one can be opened with the App-Manifest-Designer, the Uno Platform one not, there the message from below is happening.

@DevTKSS
Copy link
Contributor

DevTKSS commented Feb 10, 2025

Quickly checked the recommendations of the "open with" setting to be the regular default "App-Manifest-Designer" and would tell, that could be a possible source:
IMG_20250210_195014.jpg

@DevTKSS
Copy link
Contributor

DevTKSS commented Feb 10, 2025

and an error occurs when trying to change the file's “Generate Action” property:
getting the same, but that should please be created in an own issue, to handle this better.
Generally, image management is best done in my expirience with Uno.Resizitizer:
https://platform.uno/docs/articles/external/uno.resizetizer/doc/using-uno-resizetizer.html?tabs=singleproject%2CAndroid

@jeromelaban
Copy link
Member

For the original issue, indeed, this is not fixed even if this issue says so. This issue that was opened can be tracked instead, as it shows the same behavior.

For the second issue, let's track in #15863 and we do not have a fix for it yet.

@Mike-E-angelo
Copy link

Thank you for the clarification @jeromelaban. Please be aware that Microsoft is having trouble with the solution that I provided and I am not seeing that on my side. Is there someone that can assist with the issues they are facing?

@jeromelaban
Copy link
Member

Note that this issue does not happen when the target net9.0-windows target framework is selected in the debugger targets.

@Starcloudsea
Copy link
Author

Thank you for your help, I will keep watching these issues and hopefully this will get resolved, thanks!

@Starcloudsea
Copy link
Author

It looks like Microsoft to fix this issue and ready to release, I will retry to open the Package.appxmanifest file after the new version is released and if there are no errors, I will close this issue, thanks! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

4 participants