question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DisableImplicitNamespaceImports=false doesn't disable DisableImplicitNamespaceImports_DotNet.

See original GitHub issue

When 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.

cc: @dsplaisted @JunTaoLuo

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
DamianEdwardscommented, Oct 6, 2021

As part of the changes in rc.1 the sub-level properties were removed so this doesn’t apply anymore.

0reactions
dougbucommented, Oct 6, 2021

Reassigning to you @rafikiassumani-msft to ensure this is handled appropriately.

@safern @DamianEdwards is this issue still applicable❔

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found