Open radical opened 2 weeks ago
@radical does this not happen with other templates?
@radical does this not happen with other templates?
It happens with blazor
template too. But it works fine with the console
template. This sounds blazor specific as it is generating _Imports.razor
:
...
@using blazor__
@using blazor__.Components
And the csproj has:
blazor_π.csproj
<RootNamespace>blazor_π</RootNamespace>
@radical thanks for the additional details.
I think this might be a template bug? We are using the right template expression for the safe namespace bit https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/BlazorWeb-CSharp.csproj.in#L9
Moving this to the sdk then.
@baronfel Do you know who can help out with this on the template engine side? We think we're doing everything necessary to generate safe names.
This is fascinating. When I create this template with -v diag
here's the output I see for the name
value forms:
[2024-06-20 11:51:05.482] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}identity' was assigned to value 'blazorwasm_π'.
[2024-06-20 11:51:05.482] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}safe_name' was assigned to value 'blazorwasm___'.
[2024-06-20 11:51:05.482] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}lower_safe_name' was assigned to value 'blazorwasm___'.
[2024-06-20 11:51:05.482] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}safe_namespace' was assigned to value 'blazorwasm__'.
[2024-06-20 11:51:05.482] [Debug] [Template Engine] => [Execute] => [Template content generation]: [JoinMacro]: Variable 'name{-VALUE-FORMS-}lower_safe_namespace' was assigned to value 'blazorwasm__'.
To me, I look at this and think the same as you @MackinnonBuck - using the name{-VALUE-FORMS-}safe_namespace
should get the useable name set on the RootNamespace. But that doesn't seem to be happening. So I'd say this is a bug in the engine, but we'd need to get a deeper investigation for full details. I'll see if we can find some more details.
Is there an existing issue for this?
Describe the bug
Project created with -
dotnet new blazorwasm -o "blazorwasm_π"
, fails to build with:This was with
.net sdk
9.0.100-preview.3.24157.9
. It is also reproducible with8.0.200
.Expected Behavior
No response
Steps To Reproduce
dotnet new blazorwasm -o "blazorwasm_π"
cd "blazorwasm_π"
dotnet build
Exceptions (if any)
No response
.NET Version
No response
Anything else?
.log
appended to the name to satisfy github. msbuild.binlog.log