migrate.exe无法加载entityframework

Jes*_*ing 11 c# entity-framework ef-migrations

我在我的构建服务器上设置之前尝试在本地使用migrate.exe,但是我甚至无法在/?不收到错误的情况下运行help命令

System.IO.FileNotFoundException: Could not load file or assembly 
'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
or one of its dependencies. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)

我一直在寻找解决方案,遇到微软的migrate.exe入门页面等等,但一直未能解决这个问题.

我已经尝试将migrate.exe文件复制到我的项目/bin/Debug文件夹中,同时包含项目的dll和实体框架dll,但我仍然看到此错误(截图显示在下面).

我还验证了实体框架的dll版本,确实如此6.0.0.0.我正在使用nuget来包含实体框架,而我目前正在使用它<package id="EntityFramework" version="6.1.3" targetFramework="net45" />.

任何建议或帮助非常感谢!

证明我正在将migrate.exe文件复制到我的projects/bin/Debug目录中

小智 2

您是否使用适合您的 .NET 版本的正确 EF 程序集?

我的应用程序是使用 .NET 4.5 生成的,因此我使用\packages\EntityFramework.6.1.0\lib\net45中的程序集EntityFramework.dll和EntityFramework.SqlServer.dll以及\packages\EntityFramework.6.1.0\中的migrate.exe工具。

尝试对startUpDirectory和startUpConfigurationFile参数使用绝对路径。

例如:

migrate.exe MyAssembly.dll /startUpDirectory="C:\MyApp\bin" /startUpConfigurationFile="C:\MyApp\App.config"
Run Code Online (Sandbox Code Playgroud)

华泰