net6.0 mvc css isolation filename mismatch when using a hyphen
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 290
Description
### Describe the bug
When creating a new dotnet 6.0 project from the mvc template using the dotnet cli, if you use a hyphen in the project name and build the project, the bundled `project-name.styles.css` filename will contain a hyphen (matching the project), but the href in `_Layout.cshtml` will use an underscore (matching the namespace).
The obvious workaround is to not use hyphens in the project name, but this seems like a bug regardless.
### To Reproduce
```
user@os:~/Projects$ dotnet new mvc --name bad-filename
user@os:~/Projects$ cd bad-filename
user@os:~/bad-filename$ dotnet build
user@os:~/bad-filename$ ls obj/Debug/net6.0/scopedcss/bundle
bad-filename.styles.css
user@os:~/bad-filename$ cat Views/Shared/_Layout.cshtml
...
...
```
### Exceptions (if any)
None
### Further technical details
- Include the output of `dotnet --info`
```
.NET SDK (reflecting any global.json):
Version: 6.0.119
Commit: 044cde2ce0
Runtime Environment:
OS Name: pop
OS Version: 22.04
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/dotnet/sdk/6.0.119/
global.json file:
Not found
Host:
Version: 6.0.19
Architecture: x64
Commit: e37fab9fc9
.NET SDKs installed:
6.0.119 [/usr/lib/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.19 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.19 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Download .NET:
https://aka.ms/dotnet-download
Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info
```
- The IDE (VS / VS Code/ VS4Mac) you're running on, and its version
VS Code 1.80.0
Contributor guide
Assessment
This issue has not been assessed yet.