You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[9.0.100-rc.1.24406.1] EasyCMS app launch failed with 'Multiple constructors accepting all given argument types have been found in type 'Microsoft.AspNetCore.CookiePolicy.CookiePolicyMiddleware' exception
#21
Open
CancanTang opened this issue
Oct 25, 2024
· 0 comments
We are doing Application compatibility testing with the application against the latest .NET 9 SDK. When running the application with the .NET 9.0 build (9.0.100-rc.1.24406.1), it failed launch with below exception message: System.InvalidOperationException: 'Multiple constructors accepting all given argument types have been found in type 'Microsoft.AspNetCore.CookiePolicy.CookiePolicyMiddleware'. There should only be one applicable constructor.'
Recommended action
If this happens and you can't upgrade to a dependency injection container that implements IServiceProviderIsService, you can add ActivatorUtilitiesConstructorAttribute to the preferred constructor of the affected middleware type.
Steps To Reproduce
Open "..\EasyCMS\App\Atlass.Framework.Web.runtimeconfig.json" file .
Change the "Atlass.Framework.Web.runtimeconfig.json" file to let the app run against with dotnet-sdk-9.0.100-rc.1.24406.1
We are doing Application compatibility testing with the application against the latest .NET 9 SDK. When running the application with the .NET 9.0 build (9.0.100-rc.1.24406.1), it failed launch with below exception message:
System.InvalidOperationException: 'Multiple constructors accepting all given argument types have been found in type 'Microsoft.AspNetCore.CookiePolicy.CookiePolicyMiddleware'. There should only be one applicable constructor.'
After the investigation, it is related to a .NET 9 breaking change aspnet/Announcements#514
Recommended action
If this happens and you can't upgrade to a dependency injection container that implements IServiceProviderIsService, you can add ActivatorUtilitiesConstructorAttribute to the preferred constructor of the affected middleware type.
Steps To Reproduce
Expected Result:
Launch successfully.
Actual Result:
Launch failed with below error in Command prompt window:
Please refer to more information from dotnet/aspnetcore#57231
The text was updated successfully, but these errors were encountered: