Skip to content

Action fails with 'Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.' #1

@slaterx

Description

@slaterx

Running the action now fails with error:


2023-05-17T18:07:17.2071746Z Unhandled exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
2023-05-17T18:07:17.2072170Z Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
2023-05-17T18:07:17.2072190Z 
2023-05-17T18:07:17.2072605Z Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
2023-05-17T18:07:17.2072650Z 
2023-05-17T18:07:17.2072893Z    at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
2023-05-17T18:07:17.2073063Z    at System.Reflection.Assembly.GetTypes()
2023-05-17T18:07:17.2073450Z    at Microsoft.CodeAnalysis.Tools.Analyzers.AnalyzerFinderHelpers.<>c.<LoadAnalyzersAndFixers>b__0_0(Assembly assembly)
2023-05-17T18:07:17.2073718Z    at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
2023-05-17T18:07:17.2073975Z    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
2023-05-17T18:07:17.2074244Z    at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext()
2023-05-17T18:07:17.2074506Z    at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
2023-05-17T18:07:17.2074790Z    at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
2023-05-17T18:07:17.2075076Z    at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
2023-05-17T18:07:17.2075486Z    at Microsoft.CodeAnalysis.Tools.Analyzers.AnalyzerFinderHelpers.LoadAnalyzersAndFixers(IEnumerable`1 assemblies)
2023-05-17T18:07:17.2075941Z    at Microsoft.CodeAnalysis.Tools.Analyzers.AnalyzerReferenceInformationProvider.GetAnalyzersAndFixers(Project project)
2023-05-17T18:07:17.2076315Z    at System.Collections.Immutable.ImmutableDictionary.<>c__DisplayClass9_0`3.<ToImmutableDictionary>b__0(TSource element)
2023-05-17T18:07:17.2076571Z    at System.Linq.Utilities.<>c__DisplayClass2_0`3.<CombineSelectors>b__0(TSource x)
2023-05-17T18:07:17.2076826Z    at System.Linq.Enumerable.SelectIListIterator`2.MoveNext()
2023-05-17T18:07:17.2077254Z    at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior)
2023-05-17T18:07:17.2077634Z    at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs, Boolean avoidToHashMap)
2023-05-17T18:07:17.2077913Z    at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs)
2023-05-17T18:07:17.2078566Z    at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 keyComparer, IEqualityComparer`1 valueComparer)
2023-05-17T18:07:17.2079059Z    at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TSource,TKey,TValue](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
2023-05-17T18:07:17.2079625Z    at Microsoft.CodeAnalysis.Tools.Analyzers.AnalyzerReferenceInformationProvider.GetAnalyzersAndFixers(Solution solution, FormatOptions formatOptions, ILogger logger)
2023-05-17T18:07:17.2080286Z    at Microsoft.CodeAnalysis.Tools.Analyzers.AnalyzerFormatter.FormatAsync(Solution solution, ImmutableArray`1 formattableDocuments, FormatOptions formatOptions, ILogger logger, List`1 formattedFiles, CancellationToken cancellationToken)
2023-05-17T18:07:17.2080974Z    at Microsoft.CodeAnalysis.Tools.CodeFormatter.RunCodeFormattersAsync(Solution solution, ImmutableArray`1 formattableDocuments, FormatOptions formatOptions, ILogger logger, List`1 formattedFiles, CancellationToken cancellationToken)
2023-05-17T18:07:17.2081483Z    at Microsoft.CodeAnalysis.Tools.CodeFormatter.FormatWorkspaceAsync(FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken, String binaryLogPath)
2023-05-17T18:07:17.2081932Z    at Microsoft.CodeAnalysis.Tools.FormatCommandCommon.FormatAsync(FormatOptions formatOptions, ILogger`1 logger, CancellationToken cancellationToken)
2023-05-17T18:07:17.2082401Z    at Microsoft.CodeAnalysis.Tools.Commands.RootFormatCommand.FormatCommandDefaultHandler.InvokeAsync(InvocationContext context)
2023-05-17T18:07:17.2082755Z    at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
2023-05-17T18:07:17.2082947Z --- End of stack trace from previous location ---
2023-05-17T18:07:17.2083344Z    at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseErrorReporting>b__0>d.MoveNext()
2023-05-17T18:07:17.2083515Z --- End of stack trace from previous location ---
2023-05-17T18:07:17.2083836Z    at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
2023-05-17T18:07:17.2084014Z --- End of stack trace from previous location ---
2023-05-17T18:07:17.2084360Z    at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseVersionOption>b__0>d.MoveNext()
2023-05-17T18:07:17.2084535Z --- End of stack trace from previous location ---
2023-05-17T18:07:17.2084879Z    at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseTypoCorrections>b__0>d.MoveNext()
2023-05-17T18:07:17.2085047Z --- End of stack trace from previous location ---
2023-05-17T18:07:17.2085366Z    at System.CommandLine.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__17_0>d.MoveNext()
2023-05-17T18:07:17.2085537Z --- End of stack trace from previous location ---
2023-05-17T18:07:17.2085873Z    at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseParseDirective>b__0>d.MoveNext()
2023-05-17T18:07:17.2086039Z --- End of stack trace from previous location ---
2023-05-17T18:07:17.2086370Z    at System.CommandLine.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__4_0>d.MoveNext()
2023-05-17T18:07:17.2086541Z --- End of stack trace from previous location ---
2023-05-17T18:07:17.2086889Z    at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass7_0.<<UseExceptionHandler>b__0>d.MoveNext()
2023-05-17T18:07:17.2087421Z System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
2023-05-17T18:07:17.2087432Z 
2023-05-17T18:07:17.2087771Z File name: 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
2023-05-17T18:07:17.2088292Z  ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
2023-05-17T18:07:17.2088301Z 
2023-05-17T18:07:17.2088583Z File name: 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
2023-05-17T18:07:17.2089394Z    at System.Reflection.RuntimeAssembly.<InternalLoad>g____PInvoke|47_0(NativeAssemblyNameParts* pAssemblyNameParts, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Int32 throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
2023-05-17T18:07:17.2089996Z    at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
2023-05-17T18:07:17.2090395Z    at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName)
2023-05-17T18:07:17.2090793Z    at Microsoft.CodeAnalysis.DefaultAnalyzerAssemblyLoader.DirectoryLoadContext.Load(AssemblyName assemblyName)
2023-05-17T18:07:17.2091107Z    at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
2023-05-17T18:07:17.2091491Z    at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
2023-05-17T18:07:17.2091982Z System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
2023-05-17T18:07:17.2091992Z 
2023-05-17T18:07:17.2092282Z File name: 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
2023-05-17T18:07:17.2092823Z  ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
2023-05-17T18:07:17.2092830Z 
2023-05-17T18:07:17.2093110Z File name: 'Microsoft.CodeAnalysis, Version=4.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
2023-05-17T18:07:17.2093861Z    at System.Reflection.RuntimeAssembly.<InternalLoad>g____PInvoke|47_0(NativeAssemblyNameParts* pAssemblyNameParts, ObjectHandleOnStack requestingAssembly, StackCrawlMarkHandle stackMark, Int32 throwOnFileNotFound, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack retAssembly)
2023-05-17T18:07:17.2094443Z    at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
2023-05-17T18:07:17.2094771Z    at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName)
2023-05-17T18:07:17.2095172Z    at Microsoft.CodeAnalysis.DefaultAnalyzerAssemblyLoader.DirectoryLoadContext.Load(AssemblyName assemblyName)
2023-05-17T18:07:17.2095480Z    at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
2023-05-17T18:07:17.2095862Z    at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)

Here's the full pipeline:

steps:
  - name: Checkout
    uses: actions/checkout@v3

  - name: .NET Lint
    uses: zyactions/dotnet-lint@v1
    with:
        workspace: ./solution.sln
        severity: info
        implicit-restore: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions