Closed kenan-kajkus closed 7 months ago
Hi there, some things to look at first:
MapControllerRoute
, the stack bounces through various DI methods and ends up in PageActionDescriptorProvider
, so it could also be an unrelated DI issue. Perhaps you could check you have any non-cofoundry bits registered with the DI container.program.cs
shown in the v0.11 release post, and checking the linked Microsoft .NET 6 upgrade notes.Also, if you're using Razor pages in your app you'll need to use .AddMvc()
instead of .AddControllersWithViews()
. Perhaps you could try that anyway as the stack trace looks like it's trying to use the RazorPages PageActionDescriptorProvider
.
Hey @HeyJoel, thank you very much. Actually it was the .AddMvc(). But how does it come that with older versions of cofoundry this was not an issue?
I'm not certain, but thinking back to the .NET 6 migration I think the ASP.NET team made some changes around what was/was not registered when using AddControllersWithViews()
. So it depends what else you're using in your app. Cofoundry itself does work with just AddControllersWithViews()
, as shown in the sample app, but maybe it's just safer to use AddMvc()
in our samples.
Documentation and samples have been updated to use AddMvc()
, these changes will be published alongside the v0.12 release.
I am trying to update to cofoundry 0.11 but when I call app.UseCofoundry() in my Startup procedure i get this Exception:
My Main:
My Startup: