Open buraksarica opened 2 years ago
I transferred this to the templating repo. I'm not sure if this is an issue with the templating engine itself or with the templates.
Team, transferring issue to you. I checked it and it is indeed the case due to ambiguous source name.
I would recommend to change the source name to Company.WebApplication.1
to avoid ambiguous forms, see https://github.com/dotnet/templating/wiki/Naming-and-default-value-forms.
In the current setup the following forms are used: Transform | Input | Output |
---|---|---|
Identity | Company.WebApplication1 | Company.WebApplication1 |
Namespace | Company.WebApplication1 | Company.WebApplication1 (same as identity) |
Class Name | Company.WebApplication1 | Company_WebApplication1 |
Lowercase Namespace | Company.WebApplication1 | company.webapplication1 |
Lowercase Class Name | Company.WebApplication1 | company_webapplication1 |
Adding period will make a difference Transform | Input | Output |
---|---|---|
Identity | Company.WebApplication.1 | Company.WebApplication.1 |
Namespace | Company.WebApplication.1 | Company.WebApplication._1 |
Class Name | Company.WebApplication.1 | Company_WebApplication_1 |
Lowercase Namespace | Company.WebApplication.1 | company.webapplication._1 |
Lowercase Class Name | Company.WebApplication.1 | company_webapplication_1 |
Thanks for contacting us, @buraksarica. @vlada-shubina what do we put here to make sure that it matches the project name?
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Thanks for contacting us, @buraksarica. @vlada-shubina what do we put here to make sure that it matches the project name?
My recommendation is to change sourceName
in template.json
to Company.WebApplication.1
here(https://github.com/dotnet/aspnetcore/blob/f902dd8e154b2d20555a294ce83d21ddffaee8c4/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/.template.config/template.json#L24).
Then in template content:
Company.WebApplication.1
in the template, including hereCompany.WebApplication._1
and Company_WebApplication_1
respectively.@sayedihashimi just a heads up, this issue is a good candidate to be included in template validation, happened already couple of times.
Describe the bug
dotnet new mvc
command produces faulty style reference if project name contains - character.To Reproduce
Using cli version 6.0.2.
Further technical details
The cli generated the project successfuly. But the _layout.cshtml file has a reference to "cloudmanager.styles.css" which needs to be "cloud-manager.styles.css". So until changing the to -, the site doesn't look properly due to a 404 error.
The generator seems falsely to use root namespace name instead of project output name.