SQL Server数据库调用命令Add-Migration无法正常工作

时间:2018-06-12 20:06:04

标签: c# asp.net .net sql-server

我在asp.net社区中很新,并查看了一些教程但是当我来到数据库设置命令Add-Migration时没有用。结束时出现以下错误:

  

异常调用" SetData"用" 2"参数:"键入' Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly' Microsoft.VisualStudio.ProjectSystem.VS.Implementation,Version = 15.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'未标记为可序列化。"
  在C:\ Users \ anton.nuget \ packages \ entityframework \ 6.2.0 \ tools \ EntityFramework.psm1:720 char:5
  + $ domain.SetData(' project',$ project)
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   + CategoryInfo:NotSpecified:(:) [],MethodInvocationException
  + FullyQualifiedErrorId:SerializationException

     

异常调用" SetData"用" 2"参数:"键入' Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly' Microsoft.VisualStudio.ProjectSystem.VS.Implementation,Version = 15.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'没有标记为可序列化。"

     

在C:\ Users \ anton.nuget \ packages \ entityframework \ 6.2.0 \ tools \ EntityFramework.psm1:721 char:5
  + $ domain.SetData(' contextProject',$ contextProject)
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 〜
  + CategoryInfo:NotSpecified:(:) [],MethodInvocationException
  + FullyQualifiedErrorId:SerializationException

     

异常调用" SetData"用" 2"参数:"键入' Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly' Microsoft.VisualStudio.ProjectSystem.VS.Implementation,Version = 15.0.0.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'没有标记为可序列化。"

     

在C:\ Users \ anton.nuget \ packages \ entityframework \ 6.2.0 \ tools \ EntityFramework.psm1:722 char:5
  + $ domain.SetData(' startUpProject',$ startUpProject)
  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 〜
  + CategoryInfo:NotSpecified:(:) [],MethodInvocationException
  + FullyQualifiedErrorId:SerializationException

     

System.NullReferenceException:未将对象引用设置为对象的实例。

     

at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue [T](Project project,String propertyName)
  在System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName,Boolean useContextWorkingDirectory)
  at System.Data.Entity.Migrations.AddMigrationCommand.Execute(String name,Boolean force,Boolean ignoreChanges)
  在System.Data.Entity.Migrations.AddMigrationCommand。<> c__DisplayClass2。< .ctor> b__0()
  在System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(操作命令)

     

对象引用未设置为对象的实例。

0 个答案:

没有答案