-
Notifications
You must be signed in to change notification settings - Fork 462
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
Template Studio is unable to create an app with whitespaces or hyphen in AppName #2892
Comments
Possible to share the exact items you selected outside of MVVM Basic? I do agree it seems like a resource file for setting storage is missing. |
I selected the following: Project Type:Navigational Pane Design Pattern:MVVM Basic Pages:Web View (6 Nos), Tabbed (1 Nos), Settings (1 Nos) Features:Selected by default
Other things that I selected
|
The issue is the space in the project name. Simpler repro:
|
Not MVVMBasic specific - applies to all frameworks |
Ok thanks for the information. |
@debjyotigorai use a name like |
I'm taking this as I already have a fix, as also found this issue as part of work for #299 This issue is not new, so don't think it warrants a hotfix. It's not specific to 3.0. |
Thanks Matt for the quick triage and workaround. Unit test + fix for 3.1 then. |
Will add a fix for this and commit separately so it can go in sooner. X-Ref #1784 (Some project names cause generated apps to not work) I propopse making that a higher priority. We should do a better job of handling different input. |
I thought we grabbed the VS code for file names. Maybe the logic needs to be diff for solution/project naming. |
I am also getting this error and I believe it is due to a "-" in the project main name. I will check it without the dash and report back. |
Now it is working. Thanks for the workaround. It should warn the users of choosing a invalid project name and it's workaround before the wizard start creating the project. |
Here is the output of the main issue: System.Exception: Error executing 'Microsoft.Templates.Core.PostActions.Catalog.Merge.MergePostAction'. Related template: wts.Feat.SettingsStorage.VB. ---> System.IO.FileNotFoundException: There is no merge target for file 'C:\Users\jesse\source\repos\TNO-Crypt\TNO_Crypt\Strings\en-us\Resources_postaction.resw'. Related Template: 'wts.Feat.SettingsStorage.VB'. |
Choose a project name with only alphabets (both uppercase and lowercase). |
Yes, took the dash out and all seem to work fine. |
BTW, it is not an invalid project name. It is accepted across the board anywhere except with this extension, so in my opinion, needs to be resolved. |
I know that. I have created project names with empty spaces, dashes, underlines etc. I think Template Studio doesn't support till yet. |
Just referencing your comment of: Now it is working. Thanks for the workaround. It should warn the users of choosing a invalid project name and it's workaround before the wizard start creating the project. |
Great feedback, we are 100% fixing this issue :). Big decision is hotfix vs wait until next release. |
Yes, hyphens cause issues too. A fix is coming. |
Thank you all, appreciate it. And yes, dash is technically a hyphen :-) |
So, just curious, did the problem arise with this commit ? |
No the issue is much older. There are places where the project name is being used for the namespace without first making it safe. The merge is, for example, comparing |
Can you point me to the compare method / logic, just curios to see where you are referencing that from. I know in the previous release to this latest one, I could have a hyphen in the name and it worked fine. |
@mrgatesjunior https://github.com/Microsoft/WindowsTemplateStudio/blob/dev/code/src/Core/PostActions/Catalog/Merge/MergePostAction.cs#L37 is failing because namespaces are not matching. On the right, line 1 has a spaces in "namespace App141 Space.Activation" while on line 6, on the left, it is "namespace App141_Space.Activation" - notice the underscore. That is where the error is coming from. I can't point to a specific chage that introduced the issue as it's lost in the vast number of changes that were made for v3.0. If it did work with hyphens before then we'll release a hotfix for this. |
I now have it so it can handle assorted characters that previously caused issues. If you really wanted, you could even do this: Just need to add some more testing and then add some UI to handle some extra issues. '$' is a valid character in a project name but using it will cause WTS to fail to generate the app. This is because it is used as an identifier in the filenames of global postactions. I think we should add a warning/error when openign the wizard if the name contains any of these characters. That could then be extended to handle scenarios from #1784 |
Thank you for this. I would strictly follow what is allowed as a valid name within VS as a project name. That is just my two cents. I think one could get crazy with naming standards and conventions, but to me, the bottom line is whatever is allowed as a normal naming standard within VS is probably what you would want to follow. |
Following up elsewhere to get official rules about what is or isn't valid in a name. |
For microsoft#2892 Tempaltes use Param_RootNamespace instead of Param_ProjectName or wts.DefaultProject for namespaces
Deferring the UI warning change to #1784 (and moving that to the 3.1 milestone) so this can go in ASAP. |
Thank you for working on this ! |
Just released Hotfix for this. Updating the extension to version 3.0.19038.01 should fix this. |
I am getting the following error while creating an UWP app in C# using MVVW Basic. I think the error is related to "Setting Storage".
Error
System.Exception: Error executing 'Microsoft.Templates.Core.PostActions.Catalog.Merge.MergePostAction'. Related template: wts.Feat.SettingsStorage. ---> System.IO.FileNotFoundException: There is no merge target for file 'C:\Users\Debjyoti Gorai\source\repos\DG DEV (UWP)\DG_DEV__UWP_\Strings\en-us\Resources_postaction.resw'. Related Template: 'wts.Feat.SettingsStorage'.
at Microsoft.Templates.Core.PostActions.Catalog.Merge.MergePostAction.HandleFileNotFound(String originalFilePath, String suffix)
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, TemplateCreationResult generationResult)
at Microsoft.Templates.Core.Gen.GenController.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Templates.Core.Gen.NewProjectGenController.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Templates.UI.Services.GenerationService.d__5.MoveNext()
The text was updated successfully, but these errors were encountered: