Skip to content

PackageMigrationBase fails when used in V16 on TableExists #19543

@warrenbuckley

Description

@warrenbuckley

Which Umbraco version are you using?

16.0.0

Bug summary

The code/package Umbraco.Community.ContentLock is compiled against 15.x at the moment and I wanted to test to see if it worked in 16.0.0

It fails with this error:

System.MethodAccessException: Attempt by method 'ContentLock.Migrations.v1.InitDatabaseTable.Migrate()' to access method 'Umbraco.Cms.Infrastructure.Migrations.AsyncMigrationBase.TableExists(System.String)' failed.
   at ContentLock.Migrations.v1.InitDatabaseTable.Migrate()
   at Umbraco.Cms.Infrastructure.Packaging.PackageMigrationBase.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)

Specifics

Error

System.MethodAccessException: Attempt by method 'ContentLock.Migrations.v1.InitDatabaseTable.Migrate()' to access method 'Umbraco.Cms.Infrastructure.Migrations.AsyncMigrationBase.TableExists(System.String)' failed.
   at ContentLock.Migrations.v1.InitDatabaseTable.Migrate()
   at Umbraco.Cms.Infrastructure.Packaging.PackageMigrationBase.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)

Steps to reproduce

Install Umbraco.Community.ContentLock into an Umbraco 16.0.0 site

See the log entry after booting that it fails

Source code of migration

https://github.com/warrenbuckley/Umbraco.Community.ContentLock/blob/v15/dev/ContentLock/Migrations/v1/InitDatabaseTable.cs

No warnings of deprecation

Rider or Visual Studio compiled with 15.0.0 is not warning me that TableExists or perhaps PackageMigration is to be deprecated.

Expected result / actual result

For this to have executed and run my package migration to check for the DB table and create it if it does not exist already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions