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

[Bug] Missing Extensions Options in UnoFeatures starting from Blank Preset when creating projects with Uno Templates, VS Wizard, or Live Wizard #991

Open
agneszitte opened this issue Sep 30, 2024 · 5 comments · Fixed by #1128
Assignees

Comments

@agneszitte
Copy link
Contributor

agneszitte commented Sep 30, 2024

Description:

I'm encountering an issue with the latest Uno templates (v5.4.5) and the latest VS Uno Extension (v5.4.11) with Wizard when attempting to add various extensions options to a blank preset project. The issue affects not just Localization, but other extension options such as HTTP as well, which do not get properly reflected in the <UnoFeatures /> in the .csproj of the project. Below are the details with the Localization option as an example :

Steps to Reproduce:

Using Visual Studio Wizard:

  1. Select a Blank Preset project.

  2. Enable Dependency Injection (DI) and Localization.

  3. Create the project.

  4. Observed Behavior: The corresponding entry Localization is missing from UnoFeatures in the .csproj file of the project.

    MissingLocalizationUnoFeatureWizard.mp4

Using Live Wizard:

  1. Select a Blank Preset project.

  2. Enable Dependency Injection (DI) and Localization.

  3. At the end, notice that option -loc is missing from the generated command.

  4. Copy and paste the command to manually create the project.

  5. Observed Behavior: Obviously, no corresponding entry Localization in UnoFeatures in the .csproj file of the project.

    MissingLocalizationUnoFeatureLiveWizard.mp4

Using CLI:

  1. Use the blank preset command (dotnet new unoapp -preset=blank -o test) and manually add -di and the localization option -loc.

  2. Observed Behavior: The corresponding entry Localization is missing from UnoFeatures in the .csproj file of the project.

    MissingLocalizationUnoFeatureCli.mp4

Additional Observations:

  • Additional Live Wizard Tests:
    • Blank preset + DI produces a correct command.

Warning

Adding extensions such as Configuration or HTTP or Localization after selecting DI does not update the command at all, meaning that these options are not included in the generated project.

Live.Wizard.command.Issues.mp4

Expected Behavior:

In all cases, when selecting additional extensions such as Localization, Configuration, or HTTP, these options should be properly reflected in the UnoFeatures of the .csproj file and the generated command (for Live Wizard).

@agneszitte agneszitte changed the title [Bug] Missing Extensions Options in UnoFeatures starting from Blank Preset Projects when creating projects with Uno Templates, VS Wizard, or Live Wizard [Bug] Missing Extensions Options in UnoFeatures starting from Blank Preset when creating projects with Uno Templates, VS Wizard, or Live Wizard Sep 30, 2024
@agneszitte
Copy link
Contributor Author

agneszitte commented Sep 30, 2024

  • It needs to be verified whether this is a regression or if it's been present for a while but went unnoticed.
  • We also need to check if this issue occurs in other sections outside of Extensions.

cc @jhanvi03, @Darsh0307

@agneszitte
Copy link
Contributor Author

agneszitte commented Sep 30, 2024

Are we missing any additional tests? (cc @nickrandolph for info)

From @jeromelaban:

If we do not have such validations in the uno.templates generation, we need to add some more.

@eriklimakc
Copy link
Contributor

Two things from investigation:

  1. This issue seems to happen only in the Live Wizard. If Configuration is selected (see comment 2) in the VS Wizard or added to the CLI command, it works fine.

  2. Both HTTP and Localization need Configuration. So, we should update the docs and wizards to make sure HTTP and Localization can only be selected after Configuration is selected.

@eriklimakc
Copy link
Contributor

Localization and Http depend on Configuration, so a file in uno.templates was changed so that this dependency was added (#1128).

@DevTKSS
Copy link

DevTKSS commented Dec 5, 2024

hey there, since this is quite the same I did recognize (but after creation time) I would give some additional detail into consideration:
created the blanc project, decided I want to use http (TheCatAPI Sample Tutorial using) which made me add configuration also because I dont want the api-key to be clear typed in my solution general files (still looking for a kind of vault for this in desktop uno apps which are not needing aws or azure?) so added Tag into the project, reopened vs 2022 community edition and after checking all things it seems to be the case that beside the Namespace Uno.Extensions .... which is mentioned in the guides, for DI we have to manually add the Microsoft.Extensions.Hosting Namespace?
@agneszitte seen you also used here DI which is what I tryed to do same just without the cmd line but along the manuals with the tags, so maybe there is also a kind of dependency between them both problems?
Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants