You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to produce a repro for another bug (#19653) in preview 7, so created a brand new empty Blazor Server project using the Wizard/Template in VS for Mac 8.10 (latest version). The resulting project doesn't compile.
I tried editing the csproj file to set DisableImplicitNamespaceImports=true, but it still fails to compile due to the missing using statements that I'd now need to add, and the lack of scoping braces for the namespaces.
Expected Behaviour
Creating a new solution from a template should result in a project which compiles and runs without error.
For consideration
The philosophical wisdom of the implicit namespaces change (which is going to break most peoples' projects the first time they attempt to compile with .Net 6, unless they edit every project to disable implicit namespace imports) is probably for another forum. But at the very least, such a fundamental change needs to be accounted for in the templates so that a clean, new project made from a template will compile without error.
As well as fixing it for .Net 6 preview, perhaps a wise decision might be to introduce a new checkbox in the template wizards: "Use backward-compatible namespaces/usings", to generate brace-scoped namespaces and disabling implicit namespaces, so that people who may not have a homogenous environment can create new projects which can be compiled by previous versions of the SDK without major refactoring.
Bug Description
I was trying to produce a repro for another bug (#19653) in preview 7, so created a brand new empty Blazor Server project using the Wizard/Template in VS for Mac 8.10 (latest version). The resulting project doesn't compile.
I tried editing the csproj file to set
DisableImplicitNamespaceImports=true
, but it still fails to compile due to the missingusing
statements that I'd now need to add, and the lack of scoping braces for the namespaces.Expected Behaviour
Creating a new solution from a template should result in a project which compiles and runs without error.
For consideration
The philosophical wisdom of the implicit namespaces change (which is going to break most peoples' projects the first time they attempt to compile with .Net 6, unless they edit every project to disable implicit namespace imports) is probably for another forum. But at the very least, such a fundamental change needs to be accounted for in the templates so that a clean, new project made from a template will compile without error.
As well as fixing it for .Net 6 preview, perhaps a wise decision might be to introduce a new checkbox in the template wizards: "Use backward-compatible namespaces/usings", to generate brace-scoped namespaces and disabling implicit namespaces, so that people who may not have a homogenous environment can create new projects which can be compiled by previous versions of the SDK without major refactoring.
Environment
The text was updated successfully, but these errors were encountered: