title: EF 6 Code based migration exception: Microsoft.VisualStudio.Data.Tools.Package not serializable?
body: <p>I have this configuration </p>
  
  <pre><code>internal sealed class Configuration :DbMigrationsConfiguration&lt;IAS.Models.ApplicationDbContext&gt; {
              public Configuration() {
                  AutomaticMigrationsEnabled = false;
                  ContextKey = "IAS.Models.ApplicationDbContext";
              }
  
              protected override void Seed( IAS.Models.ApplicationDbContext context ) {
                  var baseDir = AppDomain.CurrentDomain.BaseDirectory;
                  context.Database.ExecuteSqlCommand(File.ReadAllText(baseDir + "\\MyInsertScriptsql"));
          }
      }
  </code></pre>
  
  <p>when running upate-dataabase i get the following exception</p>
  
  <blockquote>
    <p>Excepción al llamar a "SetData" con los argumentos "2": "El tipo
    'Microsoft.VisualStudio.Data.Tools.Package.Internal.OAProject' del
    ensamblado 'Microsoft.VisualStudio.Data.Tools.Pa ckage,
    Version=11.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' no
    está marcado como serializable." En D:\Dev\Insuranse Advanced
    Services\IAS\packages\EntityFramework.6.0.0\tools\EntityFramework.psm1:
    611 Carácter: 20
    +     $domain.SetData &lt;&lt;&lt;&lt; ('startUpProject', $startUpProject)
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DotNetMethodException   System.NullReferenceException: Referencia a objeto no establecida como
    instancia de un objeto.    en
    System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project
    project, Int32 shellVersion)    en
    System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebProject(Project
    project)    en
    System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String
    configurationTypeName, Boolean useContextWorkingDirectory)    en
    System.Data.Entity.Migrations.UpdateDatabaseCommand.&lt;>c_<em>DisplayClass2.&lt;.ctor>b</em>_0()
    en
    System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action
    command) Referencia a objeto no establecida como instancia de un
    objeto.</p>
  </blockquote>