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

Add wizard capability to fill the Package.appxmanifest with the provided information at Project create time to resolve packaged solution (windows) issues? #1051

Open
DevTKSS opened this issue Oct 24, 2024 · 4 comments
Labels
kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification.

Comments

@DevTKSS
Copy link

DevTKSS commented Oct 24, 2024

Current behavior

Followed along the "Counter" Tutorial (c# markup, mvux)

  1. new solution created from exact terminal line mentioned in tutorial in vs 2022 integrated Terminal
  2. added the logo.svg into Assets Folder
  3. followed up to the Uno.Resizitizer Guide -> created /Images/ folder in Assets, moved the logo.svg to there
  4. set its properties to UnoImage like guided and then there were told to go to the ItemGroup for setting the path with .png ending
  5. since the appmanifest designer in vs 2022 itself did not support the wanted actions (image was not detected in the [...] Dialog) and also didnt accepted the Non-Optional Version Numering (Version.Major 1 Version.Minor 1 Version.Build 1) I tryed to set just for making the red markings disappear and also this messaging saying this from manifest

Screenshot 2024-10-24 221015

  1. so I searched all settings in vs but no where I found something that would solve that, so I went to the Package.appxmanifest file in solution explorer as last idea.
  2. Found about 4-5 green underlinings for Attention Markers which will be the result of the errors in the before mentioned ProjectDesigner UI which did only told me "Not this way" but without any Solution-Recommendation.
    Screenshot 2024-10-24 221919
    Screenshot 2024-10-24 221952

Ah and one additional thing, I did not test: vs 2022 is telling me something about the android target, some problems, but clicked to quick on X because I do not actually target android on this moment, so might be a missing package or whatever, just to be mentioned.

Expected behavior

Build solution to any target (Skia Desktop do not have that problem! Just WinSDK!) from fresh solution template would be really beginner friendly laughing

Affected platforms

Windows (WinAppSdk)

Template Host

dotnet new

Host OS

Windows

Template Options

dotnet new unoapp -preset blank -presentation mvux -markup csharp -o Counter

(the Name differs in my screenshots because I created a new project for showing you the before/after fixing the properties, but you do know that the name is the most irrelevant thing on this)

Template Version

dotnet new details Uno.Templates
Uno.Templates
   Paketversion: 5.6.0-dev.43
   Reserviert: True
   Details: Templates for creating Uno Platform apps and libraries
   Quellfeed: https://api.nuget.org/v3/index.json
   Autoren:
      Uno Platform
   Besitzer:
      https://nuget.org/profiles/unoplatform
   Lizenzmetadaten:
      Lizenz: Apache-2.0
   Lizenzausdruck: https://licenses.nuget.org/Apache-2.0
      Lizenz-URL: https://www.nuget.org/packages/Uno.Templates/5.6.0-dev.43/license
      Repository-URL: https://github.com/unoplatform/uno.templates
   Vorlagen:
      Vorlagenname                               Kurzname       Typ       Tags                                                                                        Sprache
      -----------------------------------------  -------------  --------  ------------------------------------------------------------------------------------------  -------
      Uno Platform App                           unoapp         solution  Multi-platform/Uno Platform/Android/iOS/macOS/Mac Catalyst/Windows/Linux/WebAssembly/WinUI  C#
      Uno Platform App (.NET 8, UWP)             unoapp-uwp     solution  Multi-platform/Uno Platform/Android/iOS/Windows/macOS/Linux/WebAssembly                     C#
      Uno Platform Class Library                 unolib         project   Multi-platform/Uno Platform/Library/Android/iOS/Windows/macOS/Linux/WebAssembly             C#
      Uno Platform UI Tests Class Library        unoapp-uitest  project   Multi-platform/Uno Platform/UITest/Android/iOS/macOS/WebAssembly                            C#
      Uno Platform Maui Embedding Class Library  unomauilib     project   Multi-platform/Uno Platform/Android/iOS/Mac Catalyst/Windows/WinUI                          C#

Anything else we need to know?

After some reseach, how Microsoft wants it's stupid package to be happy to at least build (one Warning is still there) I made a few changes, which I would like to share with Uno Dev Team to review for possible implementation into future templates, so the other newbes will not have to get upset because there is no easy solution way available (at least what I found so far)

Screenshot 2024-10-24 222542

  1. Marking: Althought the Graphical Editor from Visual Studio do not give a 4. Input Textbox it do not accept 2 or 3 places, it have to be 4 (at least on my vs 2022)
  2. Marking: Publisher Attribute is not possible to be set via GUI of VS 2022 without having to create some stupid certificate (which can result in other trouble with registration)
  3. Marking: optional! Can be ignored for this, just had it added there and my screenshot programm didnt support individual marking delete.
  4. Marking: I added this manually here like mentioned above(that is most likly what you told in the tutorial if I am right), because the GUI did not found the .svg image before building which makes the resizitizer create the png you mentioned in the tutorial, but without this Logo set there (not relevant which one if its just a valid image) the compiler will prompt this to be missing property of the Identity tag.
  5. Marking: Call it stupid, but this fu*** compiler absolutly want's this stupid BackgroundColor set there and since I did not get until the "how to set colors in my application that are defined in styles" (this will be in tutorial I am abolutly sure about that) I just typed in some hex code to make the compiler happy so it might show me the application I created as packaged windows sdk app.

And thats it! giving the version number as 4 places, publisher, the Logo and BackgroundColor it had build on my win11 machine.
I mentioned the "90% solution": Like you do see down below the markings, "<rescap:Capability" is still be pointed out as Warning, but do not disable the build process. Just after changing the file there you should restart vs 2022 with the project other than me. It did tell me, that a new build process can only be started after ending the last one and it catched itself in a deadlock with the errors I showed above.
Problem is, that inside of the Capabillities tag, Intellisense do not seem to know rescap althought the import was done on the file head. ms documentation did not gave me any solution and gpt tells me exactly what there stands to be the right thing.

I hope, this can help you improve the template in any way, so the application might be able to build. maybe you could implement some kind of uno ui for input the needed values? I dont know the possibilites in templating projects, thats your expertise :)

Kind regards!

@DevTKSS DevTKSS added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification. labels Oct 24, 2024
@DevTKSS
Copy link
Author

DevTKSS commented Oct 24, 2024

for others who encountered this problem, the code to copy paste which I screenshoted from the building appxmanifest file:

Manifest file.zip

@jeromelaban
Copy link
Member

Thanks for the detailed report! We'll take a look to improve our templates.

@DevTKSS
Copy link
Author

DevTKSS commented Dec 5, 2024

@jeromelaban
can you tell if it is generally possible to maybe put this information for the package mentioned above just from the uno wizard that creates the application? seen the generally templates in this repo but not knowing the capabilitys of your wizard engine. Maybe its just not possible for such generator to edit this file type?

If it would be able, the best minimal steps would maybe be to add the Name, Description and general things just from there (most of the tags which are marked missing could be filled from the app creation in my opinion, at least if the created app is one from the recommended template, where uno.Resizitizer is present (for tags like logo which is a placeholder one contained already in the Assets) and Name would maybe just be the solution Name, publisher could be taken from the User name defined in the wizard.

If this is generally not possible, no problem, in this case I would just close this issue, because then it not needs to be listed if just not possible :)
Thanks in advance for your great work!

@DevTKSS DevTKSS changed the title Bug Blank Template dont wants to build properly to WinSDK(packaged) target following the Counter c# mvux guide, incl. 90% solution recommendation Add wizard capability to fill the Package.appxmanifest with the provided information at Project create time to resolve packaged solution (windows) issues? Dec 5, 2024
@DevTKSS
Copy link
Author

DevTKSS commented Dec 5, 2024

mark this as kind/enchancement instead of kind/bug
might not be really a bug when it is not build as packaged solution

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

No branches or pull requests

2 participants