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

C# Template Fix: File scoped namespaces #3329

Open
michael-hawker opened this issue Jan 12, 2023 · 0 comments
Open

C# Template Fix: File scoped namespaces #3329

michael-hawker opened this issue Jan 12, 2023 · 0 comments
Assignees
Labels
area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration

Comments

@michael-hawker
Copy link

Describe the bug

C# 10 introduced file scoped namespaces: https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/namespace

Since the Windows App SDK now targets .NET 6 (which has C# 10 as a default), the templates should be updated to use this new pattern and save a level of indentation in the file.

Follow-on request, related to template clean-up #3324; FYI @bpulliam

Steps to reproduce the bug

Create a new C# project

Expected behavior

namespace MyNamespace;

/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainWindow : Window
{
    public MainWindow()
    {
        this.InitializeComponent();
    }

Screenshots

No response

NuGet package version

Windows App SDK 1.2.2: 1.2.221209.1

Packaging type

No response

Windows version

No response

IDE

Visual Studio 2022

Additional context

No response

@gabbybilka gabbybilka added the area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-DeveloperTools Issues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integration
Projects
None yet
Development

No branches or pull requests

3 participants