You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I´m authoring a neat little source-generator over at https://github.com/earloc/TypealizR, where I´m doing some minor code-analysis over C# using Microsoft.CodeAnalysis.CSharp.
Recently, I wittnessed one of my github-actions to fail the build on an agent with .net6 . The build broke once I updated Microsoft.CodeAnalysis.CSharp to 4.4.0, so I donwgraded to 4.3.0 in order to get things working again.
Then I tried to just bundle the assembly as suggested here, but doing so then breaks whenever I build on an agent with .net7, giving the following error during compilation:
Unhandled Exception: System.InvalidCastException:
[A]Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax cannot be cast to
[B]Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax.
Type A originates from 'Microsoft.CodeAnalysis.CSharp, Version=4.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Roslyn\Microsoft.CodeAnalysis.CSharp.dll'.
Type B originates from 'Microsoft.CodeAnalysis.CSharp, Version=4.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'LoadFrom' at location 'C:\Users\[USERNAME]\.nuget\packages\typealizr\0.8.3\analyzers\dotnet\cs\Microsoft.CodeAnalysis.CSharp.dll'.
Is there something I can do to still support older sdks, other than just downgrading Microsoft.CodeAnalysis.CSharp?
I guess to support even older sdk´s (or good old full-fx), I would even need to downgrade to an even lesser version, right?
#107 looks kind of an enabler for my scenario, but wasn´t exactly sure.
The text was updated successfully, but these errors were encountered:
Hey folks.
I´m authoring a neat little source-generator over at https://github.com/earloc/TypealizR, where I´m doing some minor code-analysis over C# using
Microsoft.CodeAnalysis.CSharp
.Recently, I wittnessed one of my github-actions to fail the build on an agent with
.net6
. The build broke once I updatedMicrosoft.CodeAnalysis.CSharp
to4.4.0
, so I donwgraded to4.3.0
in order to get things working again.Then I tried to just bundle the assembly as suggested here, but doing so then breaks whenever I build on an agent with
.net7
, giving the following error during compilation:Is there something I can do to still support older sdks, other than just downgrading
Microsoft.CodeAnalysis.CSharp
?I guess to support even older sdk´s (or good old full-fx), I would even need to downgrade to an even lesser version, right?
#107 looks kind of an enabler for my scenario, but wasn´t exactly sure.
The text was updated successfully, but these errors were encountered: