This is a migrated thread and some comments may be shown as answers.

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

1 Answer 95 Views
AppBuilder extension for Visual Studio
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jimmy
Top achievements
Rank 1
Jimmy asked on 16 Mar 2016, 10:01 PM

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? 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan
Telerik team
answered on 17 Mar 2016, 01:31 PM
Hello,

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.


Regards,
Ivan
Telerik
 

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

 
Tags
AppBuilder extension for Visual Studio
Asked by
Jimmy
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or