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.

.NET SDK 6 Preview 7 generated file `ImplicitNamespaceImports.cs` contains error CS8773

See original GitHub issue

Good morning,

I just tracked down a CI failure to a .NET SDK update. With dotnet v6.0.100-preview.7.21379.14 our whole build is failing with the repeated error:

...obj\Debug\net6.0\PowerShellEditorServices.Test.ImplicitNamespaceImports.cs(2,1):
error CS8773: Feature 'global using directive' is not available in C# 9.0. Please use language version 10.0 or greater.

This error did not show up last night, with the same build on the same code, but using dotnet v6.0.100-preview.6.21355.2. The big difference seeming to be Preview 6 to Preview 7.

I looked at #19446, but we do not (as far as I can find) use any <Import Include=...> statements in any of our .csproj files.

We are explicitly using language version 9.0, so I will update us to 10.0 to work around this, but it seems like there may be an underlying and unintended change between the two previews?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
davidfowlcommented, Aug 18, 2021

It’ll be fixed in rc1 builds. For now you can disable the feature.

1reaction
davidfowlcommented, Aug 18, 2021

More information on the latest changes https://github.com/dotnet/sdk/issues/19521

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImplicitNamespaceImports generated codefile ...
andschwa mentioned this issue on Aug 12, 2021 .NET SDK 6 Preview 7 generated file ImplicitNamespaceImports.cs contains error CS8773 #19702.
Read more >
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >
Where are the using statements/directives in .NET 6
I just created a brand new .NET 6 web app and as I hover over the WebApplication class, I realized it stays in...
Read more >
Untitled
.net 6 global using Web15 ian. 2022 · GlobalUsings.g.cs (2,1,2,29): error CS8773: Feature 'global using directive' is not available in C# 9.0.
Read more >
Implicit Using Statements In .NET 6 - NET Core Tutorials
With Implicit Using statements, your code will have almost invisible using ... NET 6 is in preview, and is not currently available in...
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