Skip to content

Conversation

@halter73
Copy link
Member

This avoids errors like the following when building or testing in VS 2022:

5>Done building project "Microsoft.AspNetCore.Testing.csproj" -- FAILED.
5>CSC : error AD0001: Analyzer 'Microsoft.CodeAnalysis.CSharp.RemoveUnnecessaryImports.CSharpRemoveUnnecessaryImportsDiagnosticAnalyzer' threw an exception of type 'System.TypeLoadException' with message 'Could not load type 'Microsoft.CodeAnalysis.CSharp.Syntax.BaseNamespaceDeclarationSyntax' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.'.
...

image

I haven't filed an issue related to this since as far as I can tell, Microsoft.CodeAnalysis.CSharp.dll ships with VS. I don't see a realistic way to keep the latest SDKs we use in our repo always working with VS previews. Presumably this will resolve itself with VS updates.

- This should be fixed when VS 2022 updates its Microsoft.CodeAnalysis.CSharp dependency
@halter73 halter73 added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jul 24, 2021
@halter73 halter73 requested a review from dougbu July 24, 2021 00:37
@halter73 halter73 requested a review from Pilchie as a code owner July 24, 2021 00:37
@halter73 halter73 enabled auto-merge (squash) July 24, 2021 00:54
@halter73 halter73 merged commit 70479b5 into main Jul 24, 2021
@halter73 halter73 deleted the halter73/avoid-analyzer-errors branch July 24, 2021 02:01
@ghost ghost added this to the 6.0-rc1 milestone Jul 24, 2021
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants