Skip to content
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

[build] set $(DisableImplicitNamespaceImports) by default #859

Merged

Conversation

jonathanpeppers
Copy link
Member

Context: dotnet/sdk#19050

xamarin-android is hitting this build error with .NET 6 Preview 7:

C:\src\xamarin-android\external\Java.Interop\src\Java.Interop\obj\Debug\net6.0\Java.Interop.ImplicitNamespaceImports.cs(2,1):
error CS8400: Feature 'global using directive' is not available in C# 8.0. Please use language version 10.0 or greater.
[C:\src\xamarin-android\external\Java.Interop\src\Java.Interop\Java.Interop.csproj]

In fact, you can reproduce this by doing:

dotnet new console
dotnet build -p:LangVersion=8.0

It seems like @(Import) item group should not be present unless the
project is C# 10 or higher?

For now, we can set $(DisableImplicitNamespaceImports) to workaround
the issue.

Context: dotnet/sdk#19050

xamarin-android is hitting this build error with .NET 6 Preview 7:

    C:\src\xamarin-android\external\Java.Interop\src\Java.Interop\obj\Debug\net6.0\Java.Interop.ImplicitNamespaceImports.cs(2,1):
    error CS8400: Feature 'global using directive' is not available in C# 8.0. Please use language version 10.0 or greater.
    [C:\src\xamarin-android\external\Java.Interop\src\Java.Interop\Java.Interop.csproj]

In fact, you can reproduce this by doing:

    dotnet new console
    dotnet build -p:LangVersion=8.0

It seems like `@(Import)` item group should not be present unless the
project is C# 10 or higher?

For now, we can set `$(DisableImplicitNamespaceImports)` to workaround
the issue.
@jonathanpeppers jonathanpeppers merged commit 4fb7c14 into dotnet:main Jul 19, 2021
@jonathanpeppers jonathanpeppers deleted the disableimplicitnamespaceimports branch July 19, 2021 21:39
jonpryor pushed a commit that referenced this pull request Aug 25, 2021
Context: dotnet/sdk#19050

xamarin-android is hitting this build error with .NET 6 Preview 7:

    C:\src\xamarin-android\external\Java.Interop\src\Java.Interop\obj\Debug\net6.0\Java.Interop.ImplicitNamespaceImports.cs(2,1):
    error CS8400: Feature 'global using directive' is not available in C# 8.0. Please use language version 10.0 or greater.
    [C:\src\xamarin-android\external\Java.Interop\src\Java.Interop\Java.Interop.csproj]

In fact, you can reproduce this by doing:

    dotnet new console
    dotnet build -p:LangVersion=8.0

It seems like `@(Import)` item group should not be present unless the
project is C# 10 or higher?

For now, we can set `$(DisableImplicitNamespaceImports)` to workaround
the issue.
jpobst pushed a commit that referenced this pull request Sep 30, 2021
Context: dotnet/sdk#19050

xamarin-android is hitting this build error with .NET 6 Preview 7:

    C:\src\xamarin-android\external\Java.Interop\src\Java.Interop\obj\Debug\net6.0\Java.Interop.ImplicitNamespaceImports.cs(2,1):
    error CS8400: Feature 'global using directive' is not available in C# 8.0. Please use language version 10.0 or greater.
    [C:\src\xamarin-android\external\Java.Interop\src\Java.Interop\Java.Interop.csproj]

In fact, you can reproduce this by doing:

    dotnet new console
    dotnet build -p:LangVersion=8.0

It seems like `@(Import)` item group should not be present unless the
project is C# 10 or higher?

For now, we can set `$(DisableImplicitNamespaceImports)` to workaround
the issue.
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants