microlith57
microlith57
CC#
Created by microlith57 on 9/14/2024 in #help
✅ ImmutableArray<T>.Contains(T, IEqualityComparer<T>) exists in one thread, but not another
this is a very confusing problem and i have not had any luck producing a minimal working example; i'm happy to provide any kind of info. i'm making a mod for a game (Celeste) that involves compiling and loading C# source at runtime; i'm using Microsoft.CodeAnalysis.CSharp for this. i already have a standalone prototype of that process and am trying to convert it into a mod. for some reason, only in the mod version, when i call CSharpCompilation.Emit , an error is thrown in the worker thread:
System.MissingMethodException: Method not found: 'Boolean System.Collections.Immutable.ImmutableArray`1.Contains(!0, System.Collections.Generic.IEqualityComparer`1<!0>)'.
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ComputeInterfaceImplementations(BindingDiagnosticBag diagnostics, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetSynthesizedExplicitImplementations(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ForceComplete(SourceLocation locationOpt, Predicate`1 filter, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberConditionally(SourceLocation locationOpt, Predicate`1 filter, Symbol member, CancellationToken cancellationToken)
at Roslyn.Utilities.RoslynParallel.<>c__DisplayClass1_0.<For>g__errorHandlingBody|0(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
System.MissingMethodException: Method not found: 'Boolean System.Collections.Immutable.ImmutableArray`1.Contains(!0, System.Collections.Generic.IEqualityComparer`1<!0>)'.
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ComputeInterfaceImplementations(BindingDiagnosticBag diagnostics, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetSynthesizedExplicitImplementations(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ForceComplete(SourceLocation locationOpt, Predicate`1 filter, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberConditionally(SourceLocation locationOpt, Predicate`1 filter, Symbol member, CancellationToken cancellationToken)
at Roslyn.Utilities.RoslynParallel.<>c__DisplayClass1_0.<For>g__errorHandlingBody|0(Int32 i)
at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
10 replies