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

Fix compilation with latest roslyn #58769

Merged
merged 2 commits into from
Nov 3, 2024

Conversation

am11
Copy link
Member

@am11 am11 commented Nov 2, 2024

Related PR in runtime: dotnet/runtime#109467

To unblock dotnet/sdk#43015, errors like these:

/vmr/src/aspnetcore/src/DataProtection/DataProtection/src/Internal/ContainerUtils.cs(106,31): error CS0023: Operator '.' cannot be applied to operand of type 'void' [/vmr/src/aspnetcore/src/DataProtection/DataProtection/src/Microsoft.AspNetCore.DataProtection.csproj::TargetFramework=netstandard2.0]

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Nov 2, 2024
@am11
Copy link
Member Author

am11 commented Nov 2, 2024

@ViktorHofer, I wasn't able to update packages to 4.13.0-1.24510.9 because it's failing with [DiagnosticAnalyzer(LanguageNames.CSharp)]:

/workspaces/aspnetcore/src/Framework/AspNetCoreAnalyzers/src/Analyzers/RouteHandlers/RouteHandlerAnalyzer.cs(18,2): error RS1038: This compiler extension should not be implemented in an assembly containing a reference to Microsoft.CodeAnalysis.Workspaces. The Microsoft.CodeAnalysis.Workspaces assembly is not provided during command line compilation scenarios, so references to it could cause the compiler extension to behave unpredictably. (https://github.com/dotnet/roslyn-analyzers/blob/main/docs/rules/RS1038.md)

so these are the code changes only, based on search/replace. Could you try applying it as a patch to source-build? https://github.com/dotnet/aspnetcore/pull/58769.patch

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 2, 2024
@am11 am11 marked this pull request as ready for review November 3, 2024 01:44
@am11
Copy link
Member Author

am11 commented Nov 3, 2024

is this actually failing currently? Expected to fail if we update the compiler? Or ...?

The VMR legs failures in linked issue are related: https://github.com/dotnet/sdk/runs/32426310644

To make sure that we have covered all the potential issues we should update Versions.props and Version.Details.xml as part of this PR with 4.13.0-1.24510.9 (currently used by runtime and sdk), but when I tried there were some dependency issues which I'm not sure how to resolve #58769 (comment).

@mgravell
Copy link
Member

mgravell commented Nov 3, 2024

Relevant context is in this comment - basically, new extension method overloads conflicting, specifically Reverse.

Copy link
Member

@mgravell mgravell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes LGTM; can I check, however; is this actually failing currently? Expected to fail if we update the compiler? Or ...?

@ViktorHofer
Copy link
Member

ViktorHofer commented Nov 3, 2024

Yes, this is causing failures in dotnet/sdk#43015 which updates the SDK and builds the aspnetcore repo as part of the VMR. Let's get this merged to unblock that PR. We can always react to more feedback in a follow-up.

@ViktorHofer ViktorHofer merged commit 4ce2db7 into dotnet:main Nov 3, 2024
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview1 milestone Nov 3, 2024
@am11 am11 deleted the feature/roslyn-updates2 branch November 3, 2024 10:10
nkolev92 pushed a commit to nkolev92/aspnetcore that referenced this pull request Jan 24, 2025
* Fix compilation with latest roslyn

* .
captainsafia pushed a commit that referenced this pull request Feb 11, 2025
* Fix compilation with latest roslyn

* .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants