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

Load roslyn version of the codestyle analyzers to fix torn load state (causes ReflectionTypeLoadException) #72811

Open
amcasey opened this issue Mar 29, 2024 · 41 comments
Assignees
Labels
Area-IDE Bug IDE-CodeStyle Built-in analyzers, fixes, and refactorings VSCode
Milestone

Comments

@amcasey
Copy link
Member

amcasey commented Mar 29, 2024

Version Used: 4.10.0-3.24175.2+919d4dbfb0dffb35a702417e28ceea652d248bc6

Steps to Reproduce: Trigger CSharpUseCollectionInitializerCodeFixProvider

Expected Behavior:

Fix applied

Actual Behavior:

"Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.10.10.15805, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation." string

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 29, 2024
@sharwell
Copy link
Member

sharwell commented Mar 29, 2024

This is occurring because CodeGenerationParameterSymbol in the code style layer breaks Roslyn's rule that the code style layer must only reference public APIs. ISymbol does not allow public implementations:

[InternalImplementationOnly]
public interface ISymbol : IEquatable<ISymbol?>

This type must be removed from the code style layer and/or updated to no longer implement ISymbol.

@sharwell sharwell added Bug Area-IDE IDE-CodeStyle Built-in analyzers, fixes, and refactorings and removed Area-Compilers labels Mar 29, 2024
@CyrusNajmabadi
Copy link
Member

ISymbol does not allow public implementations:

That's not the case. Isymbol does not allow 3rd party impls. It allows first party impls. I know, I created it for that purpose :-)

When this interface was updated, we appropriately updated all our apis. We need to ship that updated API now.

@per-samuelsson
Copy link

per-samuelsson commented Apr 3, 2024

I have this in VS Code since earlier this morning, after I bumped some assets. I think it was the "C# Base language support" extension I bumped, and it's now on v2.23.15.

It's pretty intrusive too.

Haven't analyzed it much, but it breaks commonly used code actions, e.g. Remove unnecessary usings.

Sample:

[Error - 9:56:18 AM] [LanguageServerHost] System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.9.10.6718, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Composition.Hosting.ContainerConfiguration.<>c.<WithAssemblies>b__16_0(Assembly a)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
   at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.MefHostExportProvider.Create(String languageName)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValueLocked(TKey key, CreateValueCallback createValueCallback)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices..ctor(HostLanguageServices hostLanguageServices)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.Create(HostLanguageServices hostLanguageServices)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValueLocked(TKey key, CreateValueCallback createValueCallback)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.GetRequiredMappedCodeStyleLanguageServices(HostLanguageServices hostLanguageServices)
   at Microsoft.CodeAnalysis.RemoveUnnecessaryImports.AbstractRemoveUnnecessaryImportsCodeFixProvider.RemoveUnnecessaryImportsAsync(Document document, CodeActionOptionsProvider fallbackOptions, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(IProgress`1 progress, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs:line 350
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(IProgress`1 progress, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs:line 304
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.GetOperationsCoreAsync(Solution originalSolution, IProgress`1 progress, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs:line 241
   at Microsoft.CodeAnalysis.LanguageServer.Handler.CodeActionResolveHandler.HandleRequestAsync(CodeAction codeAction, RequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/CodeActions/CodeActionResolveHandler.cs:line 92
   at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, IMethodHandler handler, CancellationToken cancellationToken)
System.TypeLoadException: Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.9.10.6718, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.

@abbottdev
Copy link

Same issue here, using latest preview of the C# DevKit (v1.5.14 (pre-release)) and C# v2.26.13 (pre-release). I'm using Apple Silicon, .NET 8.

Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.9.10.12906, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Composition.Hosting.ContainerConfiguration.<>c.<WithAssemblies>b__16_0(Assembly a)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
   at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.MefHostExportProvider.Create(String languageName)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValueLocked(TKey key, CreateValueCallback createValueCallback)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices..ctor(HostLanguageServices hostLanguageServices)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.Create(HostLanguageServices hostLanguageServices)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValueLocked(TKey key, CreateValueCallback createValueCallback)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.GetRequiredMappedCodeStyleLanguageServices(HostLanguageServices hostLanguageServices)
   at Microsoft.CodeAnalysis.RemoveUnnecessaryImports.AbstractRemoveUnnecessaryImportsCodeFixProvider.RemoveUnnecessaryImportsAsync(Document document, CodeActionOptionsProvider fallbackOptions, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.GetChangedSolutionAsync(IProgress`1 progress, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs:line 356
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(IProgress`1 progress, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs:line 310
   at Microsoft.CodeAnalysis.CodeActions.CodeAction.GetOperationsCoreAsync(Solution originalSolution, IProgress`1 progress, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/CodeActions/CodeAction.cs:line 247
   at Microsoft.CodeAnalysis.LanguageServer.Handler.CodeActionResolveHandler.HandleRequestAsync(CodeAction codeAction, RequestContext context, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Handler/CodeActions/CodeActionResolveHandler.cs:line 92
   at Microsoft.CommonLanguageServerProtocol.Framework.QueueItem`3.StartRequestAsync(TRequestContext context, IMethodHandler handler, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework/QueueItem.cs:line 150
System.TypeLoadException: Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.9.10.12906, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
[Error - 15:16:11] Request codeAction/resolve failed.
  Message: Unable to load one or more of the requested types.
Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.9.10.12906, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
  Code: -32000 
[object Object]

@AnthonyMastrean
Copy link

Affects the misplaced using directives quick fix / code action, too.

[Error - 3:13:33 PM] [LanguageServerExtensionManager] Microsoft.CodeAnalysis.CSharp.MisplacedUsingDirectives.MisplacedUsingDirectivesCodeFixProvider threw an exception. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.7.9.1717, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Composition.Hosting.ContainerConfiguration.<>c.<WithAssemblies>b__16_0(Assembly a)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
   at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.MefHostExportProvider.Create(String languageName)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValueLocked(TKey key, CreateValueCallback createValueCallback)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices..ctor(HostLanguageServices hostLanguageServices)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.Create(HostLanguageServices hostLanguageServices)
   at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValueLocked(TKey key, CreateValueCallback createValueCallback)
   at Microsoft.CodeAnalysis.Host.CodeStyleHostLanguageServices.GetRequiredMappedCodeStyleLanguageServices(HostLanguageServices hostLanguageServices)
   at Microsoft.CodeAnalysis.CodeActions.CSharpCodeFixOptionsProviders.GetCSharpCodeFixOptionsProviderAsync(Document document, CodeActionOptionsProvider fallbackOptions, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.CSharp.MisplacedUsingDirectives.MisplacedUsingDirectivesCodeFixProvider.RegisterCodeFixesAsync(CodeFixContext context)
   at Microsoft.CodeAnalysis.CodeFixes.CodeFixService.GetCodeFixesAsync(TextDocument document, TextSpan span, CodeFixProvider fixer, CodeChangeProviderMetadata fixerMetadata, CodeActionOptionsProvider fallbackOptions, ImmutableArray`1 diagnostics, Dictionary`2 uniqueDiagosticToEquivalenceKeysMap, Dictionary`2 diagnosticAndEquivalenceKeyToFixersMap, CancellationToken cancellationToken) in /_/src/Features/LanguageServer/Protocol/Features/CodeFixes/CodeFixService.cs:line 661
   at Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](IExtensionManager extensionManager, Object extension, Func`2 function, T defaultValue, CancellationToken cancellationToken) in /_/src/Workspaces/Core/Portable/ExtensionManager/IExtensionManagerExtensions.cs:line 84
System.TypeLoadException: Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.7.9.1717, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.

@kylepope-ge
Copy link

kylepope-ge commented May 9, 2024

I have been having this exact problem on my M1 Mac as well. Happens on pretty much any codeAction which makes those unable to be used entirely. I'm using Visual Studio Code 1.89.0, C# extension 2.28.11, C# Dev Kit extension 1.5.20. Error messages look like the following every time:

[Error - 9:38:55 AM] Request codeAction/resolve failed.
  Message: Unable to load one or more of the requested types.
Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.CodeStyle.Fixes, Version=4.8.9.2411, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
  Code: -32000 
[object Object]

@kylepope-ge
Copy link

More investigation this morning on this get_IsParamsArray error... I discovered this problem is with the C# extension (I disabled my other C# Dev Kit and related extensions). The problem started happening in the 2.23.15 release. The previous release (2.22.5) doesn't have the problem, so I'm going to downgrade for now.

@Tum4ik
Copy link

Tum4ik commented May 30, 2024

I have the same problem when trying to get SyntaxGenerator for my source generation purposes.
The creation of AdhocWorkspace causes the exception:

try
{
  var syntaxGenerator = SyntaxGenerator.GetGenerator(new AdhocWorkspace(), LanguageNames.CSharp);
}
catch (ReflectionTypeLoadException e)
{
  throw;
}

@sharwell
Copy link
Member

@Tum4ik Yours is a separate issue even if it's the same exception. It's caused by attempting to load a different version of Microsoft.CodeAnalysis.dll from the version of Microsoft.CodeAnalysis.Workspaces.dll, which is not supported.

@mcallaghan-geotab
Copy link

what is the workaround?

@sharwell
Copy link
Member

sharwell commented Jun 5, 2024

There is no workaround currently. These features are currently broken even for ourselves.

@Tum4ik
Copy link

Tum4ik commented Jun 6, 2024

@mcallaghan-geotab I have Visual Studio 17.9 on my another PC, I didn't update that to 17.10 and I don't have the problem there. But @sharwell mentioned I have a different problem. Who knows... maybe you can downgrade to 17.9.

@mcallaghan-geotab
Copy link

(experiencing the problem in Rider fwiw - not visual studio)

@Tum4ik
Copy link

Tum4ik commented Jun 19, 2024

Updating Microsoft.CodeAnalysis.CSharp.Workspaces package from 4.9.2 to 4.10.0 in my source generator project has fixed the problem.

@airbreather
Copy link

Why is this not listed as a workaround somewhere? It's fair from ideal, but I can still conditionally enable it for CI builds to enforce clean, no warnings builds.

I posted #72811 (comment) just as I saw the latest round of comments and noticed that nobody had explicitly posted that on this thread.

@smkanadl
Copy link

I posted #72811 (comment) just as I saw the latest round of comments and noticed that nobody had explicitly posted that on this thread.

That slipped through. Thanks!

@smkanadl
Copy link

17.11 is out and the issue is still not fixed. What is the ETA?

@patoJamriska
Copy link

Having the same issue. tried modifying the sstyle packages and it is a no go. Momentarily using copilot as well to do code checks if needed, but can't use the quick tools for code cleanup on the UI of vscode.

@arunchndr arunchndr changed the title ReflectionTypeLoadException: CodeGenerationParameterSymbol.get_IsParamsArray VS Code impacting: Load roslyn version of the codestyle analyzers to fix torn load state (causes ReflectionTypeLoadException) Sep 6, 2024
@ericstj
Copy link
Member

ericstj commented Sep 6, 2024

The bug here is that IParameterSymbol, a publicly shipping interface, added a new property (without a default implementation):
1c5c7e2#diff-fb4bb69624c34616c08e1dc2f8236bc80b67239dd33624cd764e38976413ace9R38

That's a binary breaking change. It will break anyone that implemented IParameterSymbol before that change.

To workaround this you need to update the assembly that contains the type implementing IParameterSymbol - in this case Microsoft.CodeAnalysis.CodeStyle.Fixes to a version that has reacted to the binary breaking change in IParameterSymbol.

@ericstj
Copy link
Member

ericstj commented Sep 9, 2024

The attached repro demonstrates this binary-breaking change:
codeAnalysisRepro.zip

<ItemGroup>
    <!-- compile against older CodeAnalysis --> 
    <PackageDownload Include="Microsoft.CodeAnalysis.Common" Version="[4.8.0]" />
    <Reference Include="$(NuGetPackageRoot)\microsoft.codeanalysis.common\4.8.0\lib\netstandard2.0\Microsoft.CodeAnalysis.dll" />
    <!-- run against newer one -->
    <PackageReference Include="Microsoft.CodeAnalysis" Version="4.11.0" ExcludeAssets="Compile"/>
</ItemGroup>
var mySymbol = new MyParameterSymbol();
Console.WriteLine(((IParameterSymbol)mySymbol).Name);

#pragma warning disable RS1009  // suppress the warning to repro components allowed to implement IParameterSymbol
public class MyParameterSymbol : IParameterSymbol
{
  // IParameterSymbol implementation
}
#pragma  warning restore RS1009

run it:

Unhandled exception. System.TypeLoadException: Method 'get_IsParamsArray' in type 'MyParameterSymbol' from assembly 'codeAnalysisRepro, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
   at Program.<Main>$(String[] args)

@CyrusNajmabadi
Copy link
Member

The only supported scenario (currently) is using a version of Roslyn sdk built against the version of Roslyn your ide uses.

We are working on making it so this requirement is no longer in place. But it will change such that it is irrelevant which version you reference. You will get the version in your ide.

@sharwell
Copy link
Member

sharwell commented Sep 9, 2024

@CyrusNajmabadi I believe you mean "a version of .NET SDK where the built-in Roslyn version matches the version of Roslyn your IDE uses". When using the Roslyn SDK, e.g. for creating an analyzer or source generator, this limitation does not apply to the chosen Roslyn SDK version.

@arunchndr arunchndr changed the title VS Code impacting: Load roslyn version of the codestyle analyzers to fix torn load state (causes ReflectionTypeLoadException) Load roslyn version of the codestyle analyzers to fix torn load state (causes ReflectionTypeLoadException) Sep 10, 2024
@JoeRobich
Copy link
Member

@sharwell Can we have the design time build disable EnforceCodeStyleOnBuild? This should stop the SDK from adding the M.CA.CodeStyle analyzers. VS and VS Code would both then use the analyzers from the .Features layer, right?

@JeremyCaron
Copy link

JeremyCaron commented Sep 26, 2024

This thread has been spiraling since March 29th. Are there concrete plans for a fix here soon?

Please also note that the last working version of the C# extension mentioned above (2.22.5) is no longer available in the marketplace, which means downgrading to solve this isn't an option.

Today I learned you can right-click an extension and choose "Install Specific Version" to roll back to a much wider selection of releases, very cool. I can confirm that rolling back to 2.22.5 solved this for me as a temp workaround.

image

@CyrusNajmabadi
Copy link
Member

The fix is in progress here #75250

@canselcik
Copy link

Added EnforceCodeStyleInBuild=false, my builds have been working anyway but I can't generate migrations. Pinning the SDK to 8.0.205 didn't help either.

Basically everything worked fine until I had to touch this thing called Entity Framework. I don't even want to use Entity Framework.

$ dotnet ef migrations add TrackedOrderIds
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Composition.Hosting.ContainerConfiguration.<>c.<WithAssemblies>b__16_0(Assembly a)
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
   at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
   at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create(IEnumerable`1 assemblies) in /_/src/Workspaces/Core/Portable/Workspace/Host/Mef/MefHostServices.cs:line 55
   at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.get_DefaultHost() in /_/src/Workspaces/Core/Portable/Workspace/Host/Mef/MefHostServices.cs:line 88
   at Microsoft.CodeAnalysis.AdhocWorkspace..ctor() in /_/src/Workspaces/Core/Portable/Workspace/AdhocWorkspace.cs:line 27
   at Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper..ctor(ITypeMappingSource typeMappingSource)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite callSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass2_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(ServiceIdentifier serviceIdentifier, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType, String namespace)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType, String namespace)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
System.TypeLoadException: Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.
Unable to load one or more of the requested types.
Method 'get_IsParamsArray' in type 'Microsoft.CodeAnalysis.CodeGeneration.CodeGenerationParameterSymbol' from assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation.

@JeremyCaron
Copy link

@canselcik See my comment above, I just edited it with a description of how to rollback the C# extension to 2.22.5 which worked for me.

@canselcik
Copy link

@canselcik See my comment above, I just edited it with a description of how to rollback the C# extension to 2.22.5 which worked for me.

That worked, I appreciate it. The UI definitely doesn't help the situation.

@CyrusNajmabadi
Copy link
Member

@sharwell is this complete? If not, waht is left to be done?

@CyrusNajmabadi CyrusNajmabadi added the Need More Info The issue needs more information to proceed. label Nov 26, 2024
@dotnet-policy-service dotnet-policy-service bot added untriaged Issues and PRs which have not yet been triaged by a lead and removed Need More Info The issue needs more information to proceed. untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug IDE-CodeStyle Built-in analyzers, fixes, and refactorings VSCode
Projects
None yet
Development

No branches or pull requests