问题描述
当我尝试运行命令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.