-
Notifications
You must be signed in to change notification settings - Fork 985
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
Update C# templates with global usings #5074
Comments
I would rather name the file Bonus points: using json to store the using directives that should be global then use a source generator to generate the global usings code file. In which case I think using a json file to store the global usings is a good idea. Also which future public SDK might come with global usings shipped with it so it would not require any preview feeds / compiler packages to use those new features then? |
Why?
Why? And why do we need source generators here? |
So that way the user could clearly see where the usings are.
I just stated it as a possible option that a developer could opt into to have the global usings file get source generated for them based on a json file to define which global users it should contain. |
This comment has been minimized.
This comment has been minimized.
@RussKie the SDK feature was just merged. The epic has been updated with details of which namespaces are imported by default by the various SDKs. Please add the details for WinForms at your convenience. |
Refer to dotnet/sdk#19521 for new directions. |
@RussKie are you planning to bring this change through ASK mode for rc.1? |
(cherry picked from commit ee658c4) Fixes dotnet#5074
We can simplify our templates with global usings and have them implemented similar to this:
A sample .using file:
This list of usings looks sensible, but it is up for a discussion.
Credits for this idea go to https://github.com/khalidabuhakmeh/CsharpTenFeatures.
At some point in the future when dotnet/aspnetcore#32451 settles, we could follow in their steps and bake all typical Windows Forms usings into the Windows Desktop SDK.
The text was updated successfully, but these errors were encountered: