elsa-workflows / elsa-core

A .NET workflows library
https://v3.elsaworkflows.io/
MIT License
6.4k stars 1.19k forks source link

Could not load type 'Elsa.Metadata.ActivityDescriptor' from assembly 'Elsa.Core, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. #1614

Closed ricksearcy closed 2 years ago

ricksearcy commented 3 years ago

System.Reflection.ReflectionTypeLoadException HResult=0x80131602 Message=Unable to load one or more of the requested types. Could not load type 'Elsa.Metadata.ActivityDescriptor' from assembly 'Elsa.Core, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'Elsa.Services.Models.IActivity' from assembly 'Elsa.Abstractions, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'Elsa.Models.WorkflowDefinitionVersion' from assembly 'Elsa.Abstractions, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'Elsa.Models.WorkflowDefinitionVersion' from assembly 'Elsa.Abstractions, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'Elsa.Models.WorkflowDefinitionVersion' from assembly 'Elsa.Abstractions, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'Elsa.Models.WorkflowDefinitionVersion' from assembly 'Elsa.Abstractions, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'Elsa.Models.WorkflowDefinitionVersion' from assembly 'Elsa.Abstractions, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'Elsa.Models.WorkflowDefinitionVersion' from assembly 'Elsa.Abstractions, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null'. Source=System.Private.CoreLib StackTrace: at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeAssembly.get_DefinedTypes() at Microsoft.AspNetCore.Mvc.ApplicationParts.AssemblyPart.get_Types() at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable1 parts, ControllerFeature feature) at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature) at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetControllerTypes() at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors() at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context) at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection() at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize() at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.GetChangeToken() at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.<>c__DisplayClass11_0.<Subscribe>b__0() at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration1..ctor(Func1 changeTokenProducer, Action1 changeTokenConsumer, TState state) at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer) at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe() at Microsoft.AspNetCore.Mvc.Routing.ControllerActionEndpointDataSource..ctor(ControllerActionEndpointDataSourceIdProvider dataSourceIdProvider, IActionDescriptorCollectionProvider actions, ActionEndpointFactory endpointFactory, OrderedEndpointsSequenceProvider orderSequence) at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints) at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllers(IEndpointRouteBuilder endpoints)....

These are the packages for the Project. I don't see any mismatched package versions.

  <ItemGroup>
      <PackageReference Include="Elsa" Version="2.3.0" />
      <PackageReference Include="Elsa.Abstractions" Version="2.3.0" />
      <PackageReference Include="Elsa.Activities.Email" Version="2.3.0" />
      <PackageReference Include="Elsa.Activities.Http" Version="2.3.0" />
      <PackageReference Include="Elsa.Activities.Reflection" Version="1.5.5.1943" />
      <PackageReference Include="Elsa.Activities.Webhooks" Version="2.3.0" />
      <PackageReference Include="Elsa.Activities.Workflows" Version="1.5.5.1943" />
      <PackageReference Include="Elsa.Client" Version="2.3.0" />
      <PackageReference Include="Elsa.Core" Version="2.3.0" />
      <PackageReference Include="Elsa.Dashboard" Version="1.5.5.1943" />
      <PackageReference Include="Elsa.Designer.Components.Web" Version="2.3.0" />
      <PackageReference Include="Elsa.Persistence.MongoDb" Version="2.3.0" />
      <PackageReference Include="Elsa.Scripting.Liquid" Version="2.3.0" />
      <PackageReference Include="Elsa.Server.Api" Version="2.3.0" />
      <PackageReference Include="Elsa.WorkflowDesigner" Version="1.5.5.1943" />
      <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.7" />
  </ItemGroup>
sfmskywalker commented 3 years ago

I see at least 3 mismatches :)

ricksearcy commented 3 years ago

Could you explain? I see the 2.3.0 and the 1.5.5.1943 versions, but in VS those are the latest stable of each so I'm not clear and how to resolve. For instance there is no 2.3.0 version of Elsa.WorkflowDesigner. So the designer can not be used in conjunction with the other newer packages like the Elsa.Server.Api ? Which is actually what I am doing in dev. The server and the designer running in the same app.

sfmskywalker commented 3 years ago

Of course. Basically, all Elsa packages must be of the same version. None of the 1.x packages work with 2.x. Packages 1.x implement Elsa 1 and 2.x packages implement Elsa 2.

Elsa 2 has no backwards compatibility unfortunately.

This also means that the Elsa 1 designer does not work with the Elsa 2 API backend and neither does the Elsa 2 designer work with the Elsa 1 backend.

Elsa 2 has a new designer that you can run separately from the workflow server, or combined (as you seem to be doing now).

The documentation offers guides for both setups.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.