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

Incorrect SYSLIB1102 error #94826

Closed
JamesNK opened this issue Nov 16, 2023 · 4 comments · Fixed by dotnet/docs#38287 or #94893
Closed

Incorrect SYSLIB1102 error #94826

JamesNK opened this issue Nov 16, 2023 · 4 comments · Fixed by dotnet/docs#38287 or #94893
Assignees
Labels
area-Extensions-Configuration source-generator Indicates an issue with a source generator feature
Milestone

Comments

@JamesNK
Copy link
Member

JamesNK commented Nov 16, 2023

Description

I updated grpc/grpc-dotnet to use .NET 8 SDK. A new error showed up in a project with <PublishTrimmed>true</PublishTrimmed>: SYSLIB1102

image

The description at https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib1100-1118 says C# 11 or later is required. I verified my app is using C# 11:

<Target Name="WriteVersion" BeforeTargets="BeforeCompile">
  <Message Importance="High" Text="Version: $(LangVersion)" />
</Target>
Build started at 11:38 am...
1>------ Build started: Project: LinkerTestsWebsite, Configuration: Debug Any CPU ------
1>Version: 11.0
1>CSC(1,1,1,1): error SYSLIB1102: (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1102)
1>Done building project "LinkerTestsWebsite.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
========== Build completed at 11:38 am and took 00.520 seconds ==========

The problem disappeared after I changed <LangVersion> to 12.0.

Reproduction Steps

See grpc/grpc-dotnet#2321

Change the version back to 11.0 to see the error.

Expected behavior

Either works with C# 11, or the warning correctly says C# 12 is required.

Actual behavior

Breaks with C# 11, and a warning says C# 11 or later is required.

Regression?

I think this regressed between .NET 8 RC1 and .NET 8 RTM (although I might not have been using the final version of RC1. It definitely worked during .NET 8 previews)

Known Workarounds

No response

Configuration

No response

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 16, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Nov 16, 2023
@ghost
Copy link

ghost commented Nov 16, 2023

Tagging subscribers to this area: @dotnet/area-extensions-configuration
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

I updated grpc/grpc-dotnet to use .NET 8 SDK. A new error showed up in a project with <PublishTrimmed>true</PublishTrimmed>: SYSLIB1102

image

The description at https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib1100-1118 says C# 11 or later is required. I verified my app is using C# 11:

<Target Name="WriteVersion" BeforeTargets="BeforeCompile">
  <Message Importance="High" Text="Version: $(LangVersion)" />
</Target>
Build started at 11:38 am...
1>------ Build started: Project: LinkerTestsWebsite, Configuration: Debug Any CPU ------
1>Version: 11.0
1>CSC(1,1,1,1): error SYSLIB1102: (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1102)
1>Done building project "LinkerTestsWebsite.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
========== Build completed at 11:38 am and took 00.520 seconds ==========

The problem disappeared after I changed <LangVersion> to 12.0.

Reproduction Steps

See grpc/grpc-dotnet#2321

Change the version back to 11.0 to see the error.

Expected behavior

Either works with C# 11, or the warning correctly says C# 12 is required.

Actual behavior

Breaks with C# 11, and a warning says C# 11 or later is required.

Regression?

I think this regressed between .NET 8 RC1 and .NET 8 RTM (although I might not have been using the final version of RC1. It definitely worked during .NET 8 previews)

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: JamesNK
Assignees: -
Labels:

untriaged, area-Extensions-Configuration, needs-area-label

Milestone: -

@jkotas jkotas added source-generator Indicates an issue with a source generator feature and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 16, 2023
@tarekgh tarekgh added this to the 9.0.0 milestone Nov 16, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Nov 16, 2023
@tarekgh
Copy link
Member

tarekgh commented Nov 16, 2023

The error message is wrong. it should specify 12 not 11. The source gen is using the compiler interceptors feature which is introduced in v12.

@JamesNK
Copy link
Member Author

JamesNK commented Nov 16, 2023

If you look at the screenshot and build output, you’ll also see there is no error message, just the link. I think that should be fixed as well.

@tarekgh
Copy link
Member

tarekgh commented Nov 16, 2023

If you look at the screenshot and build output, you’ll also see there is no error message, just the link. I think that should be fixed as well.

That is interesting. We have tests to check the diag

ConfigBindingGenRunResult result = await RunGeneratorAndUpdateCompilation(BindCallSampleCode, langVersion: langVersion);
. Do you see this happen for only this generator and this message? or does it happen with other generators?

You may try the code like

and look what you get for other diags. I'll try to look too when I get a chance.

@JamesNK JamesNK reopened this Nov 17, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Nov 17, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Nov 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Extensions-Configuration source-generator Indicates an issue with a source generator feature
Projects
None yet
3 participants