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

Issues with the WinUICs templates #4413

Closed
1 of 3 tasks
mrlacey opened this issue Mar 24, 2022 · 6 comments
Closed
1 of 3 tasks

Issues with the WinUICs templates #4413

mrlacey opened this issue Mar 24, 2022 · 6 comments
Assignees
Labels
bug The issue relates to the wizard not working or a problem with the generated code. Generated Code Relates specifically to code contained in the generated project. WinUI3
Milestone

Comments

@mrlacey
Copy link
Collaborator

mrlacey commented Mar 24, 2022

Describe the bug

There are issues with the currently defined WinUI (C#) templates:

  • Some tests that validate the templates are failing
  • The generated code doesn't run and complains about a missing DLL

To Reproduce

Run test: TemplateStudioForWinUICs.Tests.TemplateFolderValidationTests.VerifyTemplateFolderContents

The output highlights that there are files in the templates folder that are not included. They should be part of the generated code or removed.

'C:\Users\matt\Documents\GitHub\WindowsTemplateStudio\code\TemplateStudioForWinUICs\Templates\Ft\SettingsStorage\Param_ProjectName\appsettings.json' is not used in the template.
'C:\Users\matt\Documents\GitHub\WindowsTemplateStudio\code\TemplateStudioForWinUICs\Templates\Ft\SettingsStorage\Param_ProjectName\Contracts\Services\ILocalSettingsService.cs' is not used in the template.
'C:\Users\matt\Documents\GitHub\WindowsTemplateStudio\code\TemplateStudioForWinUICs\Templates\Ft\SettingsStorage\Param_ProjectName\Models\LocalSettingsOptions.cs' is not used in the template.
'C:\Users\matt\Documents\GitHub\WindowsTemplateStudio\code\TemplateStudioForWinUICs\Templates\Ft\SettingsStorage\Param_ProjectName\Services\LocalSettingsServicePackaged.cs' is not used in the template.
'C:\Users\matt\Documents\GitHub\WindowsTemplateStudio\code\TemplateStudioForWinUICs\Templates\Ft\SettingsStorage\Param_ProjectName\Services\LocalSettingsServiceUnpackaged.cs' is not used in the template.

After shortening all the template paths, I did a quick smoke test to verify everything was still ok.

By creating an app with NavPane and all pages and features, the generated app:

  • won't launch the packaged version.
  • will launch the unpackaged version but immediately fails with:
System.DllNotFoundException
  HResult=0x80131524
  Message=Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
  Source=BlankAdvancedMVVMToolkitAllStyleCop
  StackTrace:
   at BlankAdvancedMVVMToolkitAllStyleCop.Program.XamlCheckProcessRequirements()
   at BlankAdvancedMVVMToolkitAllStyleCop.Program.Main(String[] args) in C:\UIT\MTM\24105055\Proj\BlankAdvancedMVVMToolkitAllStyleCop\BlankAdvancedMVVMToolkitAllStyleCop\obj\x64\Debug\net6.0-windows10.0.19041.0\win10-x64\App.g.i.cs:line 28

Additional context

This is based on #4412 being merged. It's not appropriate to look at that until that is merged.

x-ref #4398

Applies to the following platforms:

  • WinUI
  • WPF
  • UWP

About your setup

  • Visual Studio Version: 17.1.2
  • Template Studio Wizard Version: current main path
  • Windows Build: 10 21H1
@mrlacey mrlacey added bug The issue relates to the wizard not working or a problem with the generated code. needs-triage labels Mar 24, 2022
@mrlacey mrlacey added this to the Visual Studio 2022 milestone Mar 24, 2022
@mrlacey mrlacey added Generated Code Relates specifically to code contained in the generated project. WinUI3 and removed needs-triage labels Mar 24, 2022
@mrlacey mrlacey assigned mrlacey and mikebattista and unassigned mrlacey Mar 24, 2022
@mrlacey
Copy link
Collaborator Author

mrlacey commented Mar 24, 2022

App not launching issue probably connected with needing to update/reinstall VCRedist. microsoft/WindowsAppSDK#974 (comment)

@mikebattista
Copy link
Collaborator

The "unused files" are all used. How do the tests define "unused"?

I can run both packaged and unpackaged projects. Have you tried installing VCRedist to see if that fixes your issue? For unpackaged, you need the WinAppSDK Runtime installed for 1.0.1.

@mrlacey
Copy link
Collaborator Author

mrlacey commented Mar 24, 2022

The "unused files" are all used. How do the tests define "unused"?

They need to be listed in the template.json file

@mikebattista
Copy link
Collaborator

As PrimaryOutputs?

@mrlacey
Copy link
Collaborator Author

mrlacey commented Mar 24, 2022

As PrimaryOutputs?

Yes.
It may not be the case now, but they used to need to be there to get included in the generated output.
Even if they no longer do, it serves as a useful check to make sure that everything is intentionally included and we don't have any unnecessary files hanging around.

@mikebattista
Copy link
Collaborator

Fixed with fe8cddd.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug The issue relates to the wizard not working or a problem with the generated code. Generated Code Relates specifically to code contained in the generated project. WinUI3
Projects
None yet
Development

No branches or pull requests

2 participants