DisableImplicitNamespaceImports=false doesn't disable DisableImplicitNamespaceImports_DotNet.
See original GitHub issueWhen settings DisableImplicitNamespaceImports=false
, DisableImplicitNamespaceImports_DotNet
is not set to any value:
https://github.com/dotnet/sdk/blob/2c4782668099b5cf4a6b7d2a8fe26d1665798f6d/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.GenerateImplicitNamespaceImports.targets#L22
So this condition ‘$(DisableImplicitNamespaceImports_DotNet)’!=‘true’ in https://github.com/dotnet/sdk/blob/2c4782668099b5cf4a6b7d2a8fe26d1665798f6d/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.DefaultItems.props#L86 is true
and the implicit namespaces are still generated. So the only way to disable them is to set both properties to true
explicitly.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
C# 10: Disable Global Using
The presently accepted answer of disabling the ImplicitUsings MSBuild property does not affect the global using feature.
Read more >Update implicit global usings feature to address issues
Rename the MSBuild property from <DisableImplicitNamespaceImports> to <ImplicitUsings> · Add the <ImplicitUsings> property to the schema file so ...
Read more >MSBuild reference for .NET SDK projects
In .NET Core 3.0 and later versions, a framework-dependent executable is created by default. Set the UseAppHost property to false to disable ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As part of the changes in rc.1 the sub-level properties were removed so this doesn’t apply anymore.
Reassigning to you @rafikiassumani-msft to ensure this is handled appropriately.
@safern @DamianEdwards is this issue still applicable❔