Skip to content
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

New/Empty Blazor Server Project from template doesn't compile (.Net 6 preview 7) #19652

Closed
Webreaper opened this issue Aug 11, 2021 · 1 comment
Assignees
Labels
Area-External untriaged Request triage from a team member

Comments

@Webreaper
Copy link

Webreaper commented Aug 11, 2021

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.

Screenshot 2021-08-11 at 08 59 31

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.

Environment

  • Visual Studio for Mac v8.10.6 (build 10)
  • .Net 6 preview 7 (6.0.100-preview.7.21379.14, x64 version)
  • M1 MacBook Pro running Big Sur 11.5 beta
@marcpopMSFT
Copy link
Member

Old bug triage: Template issue reported in a preview. I'll assume this has been fixed.

@marcpopMSFT marcpopMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-External untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants