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

After upgrading from 2.0.2 to 2.1.0 #17109

Closed
vengi83644 opened this issue Dec 3, 2024 · 5 comments
Closed

After upgrading from 2.0.2 to 2.1.0 #17109

vengi83644 opened this issue Dec 3, 2024 · 5 comments
Labels

Comments

@vengi83644
Copy link
Contributor

image
ArgumentException: An item with the same key has already been added. Key: area
System.Collections.Generic.Dictionary<TKey, TValue>.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
System.Collections.Generic.Dictionary<TKey, TValue>.Add(TKey key, TValue value)
OrchardCore.Mvc.ModularApplicationModelProvider.OnProvidersExecuted(ApplicationModelProviderContext context)
Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelFactory.CreateApplicationModel(IEnumerable controllerTypes)
Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.GetChangeToken()
Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func changeTokenProducer, Action changeTokenConsumer)
Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe()
Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints)
Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapDynamicControllerRoute(IEndpointRouteBuilder endpoints, string pattern, object state)
OrchardCore.HomeRoute.Startup.Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
OrchardCore.Modules.ShellPipelineExtensions.ConfigurePipelineAsync(ApplicationBuilder builder)
OrchardCore.Modules.ShellPipelineExtensions.BuildPipelineInternalAsync(ShellContext context)
System.Threading.Tasks.ValueTask.get_Result()
OrchardCore.Modules.ShellPipelineExtensions.BuildPipelineAsync(ShellContext context)
OrchardCore.Modules.ModularTenantRouterMiddleware.Invoke(HttpContext httpContext)
OrchardCore.Modules.ModularTenantContainerMiddleware+<>c__DisplayClass4_0+<b__0>d.MoveNext()
OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func<ShellScope, Task> execute, bool activateShell)
OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func<ShellScope, Task> execute, bool activateShell)
OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func<ShellScope, Task> execute, bool activateShell)
OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func<ShellScope, Task> execute, bool activateShell)
OrchardCore.Environment.Shell.Scope.ShellScope.UsingAsync(Func<ShellScope, Task> execute, bool activateShell)
OrchardCore.Modules.ModularTenantContainerMiddleware.Invoke(HttpContext httpContext)

@vengi83644
Copy link
Contributor Author

vengi83644 commented Dec 3, 2024

ModularApplicationModelProvider is getting registered twice and executing twice. I don't know how to skip the 2nd execution.

@vengi83644
Copy link
Contributor Author

image

@vengi83644
Copy link
Contributor Author

@vengi83644
Copy link
Contributor Author

@hishamco

@vengi83644
Copy link
Contributor Author

Sorry, Please ignore this bug. Let me close this.

The problem was I had called "AddOrchardCms" and had called "AddMvc" too. It was working for me until 2.0.2, since we had TryAdd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant