I have no direct dependencies on either of the failing types
Migration
System.TypeLoadException: Could not load type 'NPoco.IAsyncDatabase' from assembly 'NPoco, Version=6.1.0.0, Culture=neutral, PublicKeyToken=null'.
at Umbraco.Community.CSPManager.Migrations.InitialCspManagerMigration.MigrateAsync()
at Umbraco.Community.CSPManager.Migrations.InitialCspManagerMigration.MigrateAsync()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Umbraco.Community.CSPManager.Migrations.InitialCspManagerMigration.MigrateAsync()
at Umbraco.Cms.Infrastructure.Migrations.AsyncMigrationBase.RunAsync()
at Umbraco.Cms.Infrastructure.Migrations.MigrationPlanExecutor.RunMigrationAsync(Type migrationType, MigrationContext context)
at Umbraco.Cms.Infrastructure.Migrations.MigrationPlanExecutor.RunScopedMigrationAsync(Transition transition, MigrationPlan plan)
at Umbraco.Cms.Infrastructure.Migrations.MigrationPlanExecutor.RunMigrationPlanAsync(MigrationPlan plan, String fromState)
Post Migrations on startup
Unhandled exception. System.TypeLoadException:
Could not load type 'Microsoft.OpenApi.Models.OpenApiInfo' from
assembly 'Microsoft.OpenApi,
Version=2.3.0.0, Culture=neutral, PublicKeyToken=3f5743946376f042'.
I’ve been having “funny” dependency issues with the upgrade to the new Swashbuckle/OpenApi where I think this is coming from. The NPoco error is likely a red herring.
So I can see that for some reason in your solution - the implicit usings of the OpenApi package is of the wrong version, which is throwing the whole thing off:
The trick is now to figure out which of your NuGet packages is asking for the older version of OpenApi.. the solution unfortunately might have to be that you need to take a dependency on the newest version for now.
Its odd that the repo’s test site is working… I found the same Microsoft.OpenApi 2.3.0 reference in both the package and v17 as well. Which is why I am lost
Umbraco 17 depends on Swashbuckle.AspNetCore v10.0.1, which (via Swashbuckle.AspNetCore.Swagger) depends on Microsoft.OpenApi v2.3 or higher.
Now, when reading the “Branches and support policy” for MS OpenAPI, it kind of hints at Swashbuckle v10 not supporting MS OpenApi v3.
It could be that the Swashbuckle peeps neglected to add a hard upper version boundary on their dependency. Maybe it should have been “v2.3 or higher, but less than v3”. Or, in other words, if you’re using MS OpenApi v3, perhaps you need to downgrade to v2.3 for it to work?
Seb suggested I clear my nuget caches so Ill give that ago later on this evening, This version is not on nuget, as I wanted to make sure it worked before creating the release so its only an artifact linked in my post.
Oh that’s good to know.. sorry you ran into this as well.. I am usually really strict in not allowing pre-release feeds on my machine, but sometimes I have to
But in any case, this is great to know in case other people have this problem!