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

Cannot add Setting Page via Template Studio to an existing page #4768

Open
1 of 3 tasks
Azzurriii opened this issue Nov 26, 2024 · 0 comments
Open
1 of 3 tasks

Cannot add Setting Page via Template Studio to an existing page #4768

Azzurriii opened this issue Nov 26, 2024 · 0 comments
Labels
bug The issue relates to the wizard not working or a problem with the generated code.

Comments

@Azzurriii
Copy link

Describe the bug

I'm trying to add a settings page to my existing WinUI 3 app using Template Studio (With Navigation Bar) with the MVVM pattern. However, I'm encountering the following error:

System.Exception: Error executing 'Microsoft.Templates.Core.PostActions.Catalog.Merge.MergePostAction'. Related template: ts.WinUI.MVVMToolkit.Feat.ThemeSelection. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at Microsoft.Templates.Core.PostActions.Catalog.Merge.MergeHandler.FindAndModifyContextLine(String mergeLine, Int32 diffTrivia)
   at Microsoft.Templates.Core.PostActions.Catalog.Merge.MergeHandler.Merge(IEnumerable`1 source, IEnumerable`1 merge)
   at Microsoft.Templates.Core.PostActions.Catalog.Merge.MergePostAction.ExecuteInternal()
   at Microsoft.Templates.Core.PostActions.PostAction.Execute()
   --- End of inner exception stack trace ---
   at Microsoft.Templates.Core.PostActions.PostAction.Execute()
   at Microsoft.Templates.Core.Gen.GenController.ExecutePostActions(GenInfo genInfo, ITemplateCreationResult generationResult)
   at Microsoft.Templates.Core.Gen.GenController.<GenerateItemsAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Templates.Core.Gen.NewItemGenController.<UnsafeGenerateNewItemAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Templates.UI.Services.GenerationService.<GenerateNewItemAsync>d__6.MoveNext()

Image

I've been tried:

  • Delete .vs, .bin, .obj, template studio
  • Ensure i have all the requirement SDK

Is there any one else faced this issue? And can someone fix it or its a bug?

To Reproduce

  1. Go to your existing app created by template studio
  2. click on project -> add item by template studio -> setting page -> next

Additional context

No response

Applies to the following platforms:

  • WinUI
  • WPF
  • UWP

About your setup

  • Visual Studio Version: Version 17.11.4
  • Template Studio Wizard Version: 5.5
  • Windows Build:
@Azzurriii Azzurriii added the bug The issue relates to the wizard not working or a problem with the generated code. label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue relates to the wizard not working or a problem with the generated code.
Projects
None yet
Development

No branches or pull requests

1 participant