无法加载文件或程序集“Microsoft.Build.Framework"(VS 2017)

时间:2023-02-18
本文介绍了无法加载文件或程序集“Microsoft.Build.Framework"(VS 2017)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

当我尝试运行命令update-database"时,我得到了这个异常:

When I try running the command "update-database", I get this exception:

指定-Verbose"标志以查看正在应用的 SQL 语句到目标数据库.System.IO.FileNotFoundException:不能加载文件或程序集 'Microsoft.Build.Framework, Version=15.1.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其之一依赖关系.该系统找不到指定的文件.文件名:'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'

警告:程序集绑定日志记录已关闭.启用程序集绑定失败记录,设置注册表值[HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) 为 1.注意:有是与装配绑定失败相关的一些性能损失记录.要关闭此功能,请删除注册表值[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' 或它的依赖项之一.系统找不到指定的文件.`

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' 或它的依赖项之一.系统找不到指定的文件.'

我正在使用 Visual Studio 2017 并尝试在 Add-Migration 之后执行 Update-Database.

I am using Visual Studio 2017 and was trying to do Update-Database after Add-Migration.

为了解决这个问题,我关闭了 Visual Studio 并重新打开它,然后再次重新运行 Update-Database.

To resolve the issue I closed Visual Studio and re-opened it, then re-ran Update-Database again.

这可能会也可能不会解决您的问题,但我想我会发布以防万一.

This may or may not resolve your issue, but I thought I'd post just in case it would help.

这篇关于无法加载文件或程序集“Microsoft.Build.Framework"(VS 2017)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:项目使用 Visual Studio 构建良好,但从命令行失败 下一篇:使用 TeamCity 的“dotnet restore"与“nuget restore"

相关文章

最新文章