問題描述
當(dāng)我嘗試運行命令update-database"時,我得到了這個異常:
When I try running the command "update-database", I get this exception:
指定-Verbose"標(biāo)志以查看正在應(yīng)用的 SQL 語句到目標(biāo)數(shù)據(jù)庫.System.IO.FileNotFoundException:不能加載文件或程序集 'Microsoft.Build.Framework, Version=15.1.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其之一依賴關(guān)系.該系統(tǒng)找不到指定的文件.文件名:'Microsoft.Build.Framework,版本=15.1.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a'
Specify the '-Verbose' flag to view the SQL statements being applied to the target database. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
警告:程序集綁定日志記錄已關(guān)閉.啟用程序集綁定失敗記錄,設(shè)置注冊表值[HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) 為 1.注意:有是與裝配綁定失敗相關(guān)的一些性能損失記錄.要關(guān)閉此功能,請刪除注冊表值[HKLMSoftwareMicrosoftFusion!EnableLog].
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog].
無法加載文件或程序集Microsoft.Build.Framework,版本=15.1.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a' 或它的依賴項之一.系統(tǒng)找不到指定的文件.`
Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.`
推薦答案
我相信我遇到了和你一樣的問題.我沒有保存整個錯誤消息,但我的錯誤消息是
I believe I had the same issue as you did. I didn't save the whole error message, but my error message was
'無法加載文件或程序集'Microsoft.Build.Framework,版本=15.1.0.0,文化=中性,PublicKeyToken=b03f5f7f11d50a3a' 或它的依賴項之一.系統(tǒng)找不到指定的文件.'
我正在使用 Visual Studio 2017 并嘗試在 Add-Migration
之后執(zhí)行 Update-Database
.
I am using Visual Studio 2017 and was trying to do Update-Database
after Add-Migration
.
為了解決這個問題,我關(guān)閉了 Visual Studio 并重新打開它,然后再次重新運行 Update-Database
.
To resolve the issue I closed Visual Studio and re-opened it, then re-ran Update-Database
again.
這可能會也可能不會解決您的問題,但我想我會發(fā)布以防萬一.
This may or may not resolve your issue, but I thought I'd post just in case it would help.
這篇關(guān)于無法加載文件或程序集“Microsoft.Build.Framework"(VS 2017)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!