无法加载文件或程序集'Microsoft.Build.Framework'(VS 2017) [英] Could not load file or assembly 'Microsoft.Build.Framework'(VS 2017)

查看:842
本文介绍了无法加载文件或程序集'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, 文化=中性,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'

WRN:程序集绑定日志记录已关闭.启用程序集绑定 失败日志记录,设置注册表值 [HKLM \ Software \ Microsoft \ Fusion!EnableLog](DWORD)为1.注意: 与程序集绑定失败相关的一些性能损失 记录.要关闭此功能,请删除注册表值 [HKLM \ Software \ Microsoft \ Fusion!EnableLog].

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!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 [HKLM\Software\Microsoft\Fusion!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'或 它的依赖项之一.系统找不到指定的文件.'

'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.'

我正在使用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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆