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

Could not load file or assembly #39;Microsoft.Build.Framework#39;(VS 2017)(无法加载文件或程序集“Microsoft.Build.Framework(VS 2017))
本文介绍了无法加载文件或程序集“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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

MSBuild cannot find a reference(MSBuild 找不到参考)
The reference assemblies for framework .NETCore, Version=v5.0 were not found(未找到框架 .NETCore,Version=v5.0 的参考程序集)
quot;File has a different computed hash than specified in manifestquot; error when signing the EXE(“文件的计算哈希值与清单中指定的不同签署EXE时出错)
Good-practices: How to reuse .csproj and .sln files to create your MSBuild script for CI?(良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 MSBuild 脚本?)
Run an MSBuild target only if project is actually built(仅在实际构建项目时运行 MSBuild 目标)
MS-Build BeforeBuild not firing(MS-Build BeforeBuild 未触发)