AppBuilder Extensions conflict with EntityFramework tools (Enable-Migrations fails)

Thread is closed for posting
2 posts, 1 answers
  1. Jimmy
    Jimmy avatar
    2 posts
    Member since:
    Jun 2014

    Posted 16 Mar 2016 Link to this post

    It appears when the AppBuilder extension is enabled, you're unable to execute the command "Enable-Migrations" to enable code first Entity Framework migrations. Doing so causes this error to be returned:

    PM> Enable-Migrations
    Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudioTools.Project.Automation.AbOAProject' in assembly 'Telerik.BlackDragon.MpfBaseClasses,
    Version=2016.1.128.6, Culture=neutral, PublicKeyToken=28c6af4ce7dade13' is not marked as serializable."
    At C:\Development\AthleteTracker\DEV\Source\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:720 char:5
    +     $domain.SetData('startUpProject', $startUpProject)
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : SerializationException
    System.NullReferenceException: Object reference not set to an instance of an object.
       at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project project, Int32 shellVersion)
       at System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebProject(Project project)
       at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory)
       at System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable(String contextTypeName)
       at System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0()
       at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
    Object reference not set to an instance of an object.


    Disabling the AppBuilder Extensions allows the command to execute properly. Is this a known issue, is there a fix? 


  2. Answer
    Ivan avatar
    106 posts

    Posted 17 Mar 2016 Link to this post


    I reviewed your stacktrace and examined the behavior of the "Enable-Migrations" command. The issue is caused by the fact that your startup project is an AppBuilder one and EntityFramework has no support for it.
    In order to fix this you must change your startup project to a non-AppBuilder one.

    If you have any questions or remarks, please do not hesitate to contact us again.


    Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

Back to Top