title: VS 2015 ASP.NET Web API (EF6) & Xamarin Enable-Migrations fails
body: <p>I'm developing a project that will use ASP.NET Web API as the data service, and a Xamarin portable app as client.</p>
  <p>I'm trying to enable migrations in the web app, but I get the following error:</p>
  <pre><code>Enable-Migrations -enableautomaticmigrations -ContextTypeName MyProject.Models.ApplicationDbContext -ProjectName MyProject -StartupProjectName MyProject.App -Verbose
  Using StartUp project 'MyProject.App'.
  Exception calling &quot;SetData&quot; with &quot;2&quot; argument(s): &quot;Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 
  'Microsoft.VisualStudio.ProjectSystem.VS.Implementation, Version=14.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.&quot;
  At C:\Users\weitz\.nuget\packages\EntityFramework\6.1.3\tools\EntityFramework.psm1:718 char:5
  +     $domain.SetData('project', $project)
  +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : SerializationException
   
  Exception calling &quot;SetData&quot; with &quot;2&quot; argument(s): &quot;Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 
  'Microsoft.VisualStudio.ProjectSystem.VS.Implementation, Version=14.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.&quot;
  At C:\Users\weitz\.nuget\packages\EntityFramework\6.1.3\tools\EntityFramework.psm1:719 char:5
  +     $domain.SetData('contextProject', $contextProject)
  +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
      + FullyQualifiedErrorId : SerializationException
   
  System.NullReferenceException: Object reference not set to an instance of an object.
     at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T](Project project, String propertyName)
     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.&lt;&gt;c__DisplayClass2.&lt;.ctor&gt;b__0()
     at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
  Object reference not set to an instance of an object.
  **PM&gt;**
  </code></pre>
  <p>As you can see, I've tried specifying the start up project explicitly but doesn't look like the enable-migrations command is so happy about it.</p>
  <p>It's a project I just created that uses full .NET (I'm bound to TPT/TPH model which EF Core doesn't support yet), so the EF version is 6.1.3 targeting .NET 4.6.1.</p>
  <p>I'm on VS Community 2015 Update 3 Version 14.0.25431.01.</p>
  <h1>Update</h1>
  <p>Can't reproduce, but the issue happens even when adding a dummy start up project.<br />
  Cross posted issue <a href="https://github.com/aspnet/EntityFramework6/issues/317" rel="nofollow noreferrer">here</a>, please vote and share your experiments.</p>