Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# EF核心添加迁移不';t工作-找不到程序集x64而不是x86_C#_Entity Framework_Asp.net Core_Entity Framework Migrations - Fatal编程技术网

C# EF核心添加迁移不';t工作-找不到程序集x64而不是x86

C# EF核心添加迁移不';t工作-找不到程序集x64而不是x86,c#,entity-framework,asp.net-core,entity-framework-migrations,C#,Entity Framework,Asp.net Core,Entity Framework Migrations,我想在x64机器上使用.NET Framework 4.5.2构建x86 ASP.NET核心。所以我安装了sdkx86。 当我在PMC中运行migration命令addmigration Init时,它会抛出: Could not find assembly '...\.\bin\Debug\net452\win7-x64\MisapayHub.exe'. Project.json: { "dependencies": { // others.... "Microsoft.A

我想在x64机器上使用.NET Framework 4.5.2构建x86 ASP.NET核心。所以我安装了sdkx86。 当我在PMC中运行migration命令
addmigration Init
时,它会抛出:

Could not find assembly '...\.\bin\Debug\net452\win7-x64\MisapayHub.exe'. Project.json:

{
  "dependencies": {
    // others....
    "Microsoft.AspNet.WebApi.Core": "5.2.3",        
    "Microsoft.EntityFrameworkCore": "1.1.0",
    "Microsoft.EntityFrameworkCore.Design": "1.1.0",
    "Microsoft.EntityFrameworkCore.Relational": "1.1.0",
    "Microsoft.EntityFrameworkCore.Sqlite": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
  },

  "tools": {
  },

  "frameworks": {
    "net452": {}
  },

  "buildOptions": {
    "platform": "anycpu",
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },
  "runtimes": {
    "win7-x86": {},
    "win7-x64": {}
  },

  // others...
}

因此,在本地计算机中创建的文件夹包含一个带有“win7-x87”的文件夹,如下所示

“…\bin\Debug\net452**win7-x86**\MisapayHub.exe”

您得到的错误是无法在名为“win7-x64”的文件夹中找到Assembly,如下所示

找不到程序集“..\bin\Debug\net452\win7-x64\MisapayHub.exe”


最简单的解决方案是导航到net452文件夹并将“win7-x86”重命名为“win7-x64”,这将解决该问题。

您解决了问题吗?没有,我逐个修复此问题时会出现许多不同的错误。我通过创建一个新项目来解决这个问题,该项目包含新的db迁移和对现有项目的复制。希望它能在下一个ef版本上正常工作。
- Windows 10 x64.
- Visual Studio 2015 Update 3.
- DotNet Core 1.1.0 x86
{
  "dependencies": {
    // others....
    "Microsoft.AspNet.WebApi.Core": "5.2.3",        
    "Microsoft.EntityFrameworkCore": "1.1.0",
    "Microsoft.EntityFrameworkCore.Design": "1.1.0",
    "Microsoft.EntityFrameworkCore.Relational": "1.1.0",
    "Microsoft.EntityFrameworkCore.Sqlite": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
  },

  "tools": {
  },

  "frameworks": {
    "net452": {}
  },

  "buildOptions": {
    "platform": "anycpu",
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },
  "runtimes": {
    "win7-x86": {},
    "win7-x64": {}
  },

  // others...
}