-
Notifications
You must be signed in to change notification settings - Fork 363
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 console & classlib project templates to opt-in to ImplicitUsings feature #3619
Comments
FYI @vlada-shubina |
@bekir-ozturk @DavidKarlas could you please take it over whilst I'm on leave? Thanks |
I looked into making this change... We need SDK to make switch first so our integration tests can pass... |
@DavidKarlas why is that? The property is benign right now so I think the opposite is true isn't it? Add the property now so that when the SDK change lands the templates continue to get implicit usings applied. |
Problem is that if user specify following parameters:
and tries to build project using
|
I think the issue is that the templates should be made dependent on language versions set. However I think that with .NET 6 one should not be able to downgrade to C# 9 or lower due to the issue pointed above about global usings not being in C# 9. |
The templates that support specifying version as an option (like classlib and console) could decide to condition the addition of |
I have that change ready, problem is that integration tests are failing with error message from previous comment with current SDK, hence need to wait for SDK change... I guess I could disable those tests temporary... I will open PR |
@DavidKarlas ah sorry I understand now. I keep forgetting the classlib and console templates are "special" in that they support defining language version and thus you'd have tests for that 😄 Do the needful to coordinate the changes. |
Perhaps what should be done is default the templates to disabled but have a line that overrides it like so:
I think with the .NET 6 SDK that technically all 3 values would mean the same thing? Also I think with this it would make it a minimal yet also non-breaking change for tests? |
@AraHaan as long as the conditions are evaluated by the template engine at project creation time, rather than staying as MSBuild conditions in the project file, I think it makes sense to default the inclusion of |
Alternatively why not have the .NET Sdk enable automatically it for the user if they select a language version of 10 or newer? |
@AraHaan that's effectively what I'm saying and the PR does AFAICT. |
@DavidKarlas can this issue be closed now that your PR is merged? |
@DavidKarlas a build of the installer with the SDK changes are available in case you needed to update your tests. |
I noticed, thank you, I'm working on making changes, tnx! |
With removal of |
To prepare for the changes coming in dotnet/sdk#19521 we need to update the .NET 6 project templates to include the
<ImplicitUsings>enable</ImplicitUsings>
property setup in their project files.The text was updated successfully, but these errors were encountered: