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

dotnet/sdk needs to build for net472 during source-build #2548

Closed
eerhardt opened this issue Oct 21, 2021 · 5 comments
Closed

dotnet/sdk needs to build for net472 during source-build #2548

eerhardt opened this issue Oct 21, 2021 · 5 comments
Labels
area-additional-repos Adding additional contributing repos

Comments

@eerhardt
Copy link
Member

In order for OmniSharp to work with a source-built .NET SDK, we need to build our MSBuild tasks for netfx. This is because OmniSharp uses Mono. For example, see #2006.

In 5.0, we built the SDK tasks for netfx. But in dotnet/sdk#19649 we stripped the netfx TFM during the build.

@MichaelSimons @crummel @dagood @dseefeld

@MichaelSimons
Copy link
Member

[Triage] A fix for this was submitted as a patch. The patch needs to get backported.

@lambdageek
Copy link
Member

(Not sure if this is the same underlying issue, but I think it is)

Another symptom is that OmniSharp may fail to load some analyzers such as https://github.com/dotnet/roslyn-analyzers/blob/main/src/NetAnalyzers/Core/Microsoft.NetFramework.Analyzers/TypesShouldNotExtendCertainBaseTypes.cs
because Microsoft.CodeAnalysis.NetAnalyzers.dll from source build references System.Collections.Immutable.dll version 6.0, whereas the official SDK NetAnalyzers.dll references System.Collections.Immutable.dll version 1.2.3.0.

As a result during O# initialization Mono may print errors such as:

Failure while loading the analyzer reference 'Microsoft.CodeAnalysis.NetAnalyzers': Type Microsoft.NetFramework.Analyzers.TypesShouldNotExtendCertainBaseTypesAnalyzer has invalid vtable method slot 5 with method none

(The issue is that the type of the DiagnosticAnalyzer.SupportedDiagnostics property is ImmutableArray<DiagnosticDescriptor> where ImmutableArray<> comes from System.Collections.Immutable. Since the NetAnalyzers.dll wants a newer version of System.Collections.Immutable than what comes with OmniSharp/mono, the class initialization fails and Mono prints this unhelpful error message).

/cc @webczat

@MichaelSimons
Copy link
Member

@lambdageek - can you please log a separate issue for the OmniSharp issue you encountered?

@MichaelSimons
Copy link
Member

Closing this as the patch was backported - dotnet/sdk#23266

@webczat
Copy link

webczat commented Feb 1, 2022

I think we confirmed it was exactly that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-additional-repos Adding additional contributing repos
Projects
None yet
Development

No branches or pull requests

4 participants