title: Enable-Migrations "Object reference not set to an instance of an object"
body: <p>I just created a new service fabric service that will periodically attempt to save some models to SQL Azure using Entity Framework and the Elastic Client Database library. I'm trying to model it as closely as I can to the SQL Azure Elastic Scale Client Library EF sample (<a href="https://code.msdn.microsoft.com/windowsapps/Elastic-Scale-with-Azure-bae904ba" rel="noreferrer">Elastic DB Tools EF Sample</a>). I'm at the point where I need to enable migrations, but when I run Enable-Migrations I'm getting the following error message. I'm using the ContextTypeName parameter since it sounded like it would be required if I'm going to eventually have different service fabric services targeting the same database with different models. Any suggestions?</p>
  
  <pre><code>PM&gt; Enable-Migrations -ContextTypeName "ServiceHealth.DbService"
  Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is 
  not marked as serializable."
  At C:\eNowCloud\eNow.MicroServices\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.&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.
  </code></pre>