![](/img/trans.png)
[英]migrate.exe, on a build server, wants to “start over” with migrations
[英]migrate.exe could not load entityframework
我在我的構建服務器上設置之前嘗試在本地使用migrate.exe,但我甚至無法運行幫助命令/?
沒有得到錯誤
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.
我一直在尋找解決方案,遇到微軟的migrate.exe入門頁面等等,但一直未能解決這個問題。
我已經嘗試將migrate.exe文件復制到我的projects /bin/Debug
文件夾以及項目的dll和實體框架dll,但我繼續看到此錯誤(截圖顯示在下面)。
我還驗證了實體框架的dll版本,它確實是6.0.0.0
。 我正在使用nuget來包含實體框架,我目前正在使用<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
。
任何建議或幫助非常感謝!
您是否在.NET版本中使用正確的EF程序集?
我的應用程序使用.NET 4.5生成的,所以我用的組件EntityFramework.dll和EntityFramework.SqlServer.dll從\\包\\ EntityFramework.6.1.0 \\ LIB \\ net45和\\包 migrate.exe \\ EntityFramework.6.1.0 \\工具 。
嘗試使用startUpDirectory和startUpConfigurationFile參數的絕對路徑。
例如:
migrate.exe MyAssembly.dll /startUpDirectory="C:\MyApp\bin" /startUpConfigurationFile="C:\MyApp\App.config"
HTH
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.