elsa-workflows / elsa-workflows/elsa-core

Application startup failure after migration to .NET 10 — missing Swashbuckle.AspNetCore.SwaggerGen v10.0.7 reference in Elsa.Activities.Http.OpenApi

Open
#7,429 2 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
7.9k
Forks
1.5k
Avg merge
15h 22m
Merged PRs (30d)
114

Description

## Description
After migrating the host application to .NET 10, the application crashes at startup during the UseEndpoints pipeline configuration. The root cause is a non-backward-compatible namespace refactor introduced in Swashbuckle.AspNetCore.SwaggerGen version 10.0.7: key types that existed in v6.x were renamed and reorganized, making the HttpEndpointDocumentFilter class in Elsa.Activities.Http.OpenApi incompatible with the version now resolved at runtime.

The class implements IDocumentFilter and uses DocumentFilterContext from the Swashbuckle v6 API. In Swashbuckle v10 these types were restructured in a breaking, non-backward-compatible manner. Because Elsa.Activities.Http.OpenApi does not explicitly reference Swashbuckle.AspNetCore.SwaggerGen in its .csproj, the assembly is resolved from the transitive dependency brought in by Elsa.Server.Api (v10.0.7), whose API is incompatible with the code written against v6.3.

The build succeeds with no compile-time errors. The failure only surfaces at runtime, during the ASP.NET Core endpoint routing reflection pipeline introduced in .NET 10.

HttpEndpointDocumentFilter must be updated to use the new Swashbuckle v10 API, or an explicit version constraint must be added to pin the dependency to a v6.x-compatible release.

## Steps to Reproduce

1. Take an existing project referencing Elsa.Server.Api and Elsa.Activities.Http.
2. Migrate the target framework to net10.0.
3. Update all NuGet packages to versions compatible with .NET 10 — including Elsa.Server.Api.
4. Build the project — build succeeds without errors or warnings.
5. Run the application and observe the startup pipeline.
6. Reproduction rate: every time, 100% reproducible after migrating to .NET 10

## Expected Behavior
The application starts successfully on .NET 10. HttpEndpointDocumentFilter is registered and applied without errors, using an API that is compatible with the version of Swashbuckle distributed alongside Elsa.Server.Api.

## Actual Behavior
The ASP.NET Core .NET 10 reflection pipeline fails to resolve the Swashbuckle v6 types (IDocumentFilter, DocumentFilterContext) referenced by HttpEndpointDocumentFilter, throwing a runtime exception and immediately terminating the host.

## Screenshots
If possible, add screenshots or screen recordings to help explain the problem.

## Environment
- **Elsa Package Version**: 2.16.1
- **Operating System**: Linux alpine.
- **Target framework**: net10

## Log Output
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.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe()
at Microsoft.AspNetCore.Builder.RazorPagesEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints)
at Microsoft.AspNetCore.Builder.RazorPagesEndpointRouteBuilderExtensions.MapFallbackToPage(IEndpointRouteBuilder endpoints, String page)

## Troubleshooting Attempts

- Confirmed the build succeeds with no compile-time errors — the breaking change only manifests at runtime.
- Analysed the full NuGet dependency graph and identified that Swashbuckle.AspNetCore.SwaggerGen v10.0.7 is pulled in transitively by Elsa.Server.Api.
- Confirmed the issue does not occur on net8.0, where the assembly loader tolerates implicit transitive dependencies more permissively.
- Verified that HttpEndpointDocumentFilter is written against the Swashbuckle v6.x API, which is incompatible with v10.0.7.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.