-
Notifications
You must be signed in to change notification settings - Fork 378
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
Console/Class lib project templates use latest C# language idioms #3360
Comments
Couple things here:
|
@DamianEdwards There is an enormous amount of tutorials, instructions, books, etc in the wild that has been created over the years. This includes everything from high school curriculum to SO posts and is used by the people that are introducing .NET for us. Given the amount of this information and the fact it fundamentally not working affects our newest customers as they are just trying .NET, we decided that a new template was least disruptive. In addition, the name "console" has meaning only from the perspective of the tech, not naïve intuition. We decided to "freeze" Console, and thus did not add nullable. For these reasons we added a new "app" template with the expectation that all beginner instructions etc. will change to this template over (hopefully short) time allowing us to make this change without disrupting our new users and have a better name. In addition to the scenario where a teacher hands out instructions that make no sense, someone could rebuild their laptop a week before finals to do some end semester work and be unable to do it. We can instead teach teachers about using these new features and allow them to introduce namespaces and class at the time they think appropriate. Of course we update things that can be disruptive, but this massive change to Console would disrupt the wrong people at the wrong time. Something else has taken a great deal of time over the last several days, and thus the blog post for templates in Preview 6 was delayed. |
@vlada-shubina There is another change we are working on that will affect global usings overall. So hold off on that change to the app template please. |
@KathleenDollard thanks for the details. Given that context, are we planning on removing console from the default list shown when @vlada-shubina no need to add |
@DamianEdwards @KathleenDollard File-scoped namespaces were added in #3395, however these templates cannot be built at the moment, therefore we cannot merge it until it is supported for build. |
@vlada-shubina thanks, this is the compiler issue to watch for them landing the file-scoped namespaces feature in preview.7 |
@DamianEdwards on this thread: we are removing app template #3423 now and porting all features of it to console net6.0 template. @DamianEdwards @KathleenDollard what should be behavior or the features with regards to language version: we have a parameter
Should we make a condition on those or should the template just fail in case lang version is different from 10.0? How other repos are handling |
@DamianEdwards @KathleenDollard another issue blocking PRs with global usings: global usings are not working for language version other than 10.0. The project on language version below 10.0 cannot be compiled. Example:
Is it expected failure? How we should deal with other language versions in net6.0 templates? |
@vlada-shubina yes global usings requires C# 10. @JunTaoLuo do the implicit namespace conditions in the SDK not include a check of LangVersion if it's defined? |
I'm hesitant about a LangVersion check. Specifically, I couldn't find a good way of expressing the logic "LangVersion >= 10.0". LangVersion can be set to non-numerical values such as As for the tests being blocked, could we disable the feature with Another idea is that we should output a better error message somehow that indicates if CS8773 occurs, |
@JunTaoLuo I see, we have the similar problem here. We have a @DamianEdwards have you discussed this issue before? dotnet/templating is not the only repo using As example:
|
Yeah seems we'll have to condition this in the templates that have a Your enumeration seems like the correct approach. |
changed SDK version
changed SDK version
changed SDK version
changed SDK version
changed SDK version
changed SDK version
@DamianEdwards all tasks in this issue have been completed, closing. Feel free to reopen if needed. |
The file-scoped namespaces portion of this change is causing some pain, as the IDE experience is not yet fully baked for this feature. Added you to the email thread to discuss temporarily reverting that change. Thanks |
changed SDK version
changed SDK version
changed SDK version
In .NET 6, the included C# project templates will use the latest language idioms.
See the parent Epic for details.
Console template:
Classlib template:
Issues:
@KathleenDollard
The text was updated successfully, but these errors were encountered: