Techtalk.Specflow错误:无法加载程序集文件或程序集 [英] Techtalk.Specflow error: Could not load assembly file or assembly

查看:50
本文介绍了Techtalk.Specflow错误:无法加载程序集文件或程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前已经看过这个问题,但我相信它并没有解决.基本上我的设置是这样的:VS 2015Specflow版本1.9.0(基于其他无济于事的问题,我从2.1.0降级至此)

I have seen this question before but I believe it was not resolved. Basically my set up is this: VS 2015 Specflow ver 1.9.0 (I downgraded to this from 2.1.0 based on other question which didn't help)

当我尝试构建项目时,它伴随着以下错误:

When I try to build my project, it comes with the follwoing error:

#error Generation error: Could not load file or assembly 'TechTalk.SpecFlow, Version=1.9.0.77, Culture=neutral, PublicKeyToken=0778194805d6db41' or one of its dependencies. The system cannot find the file specified.

推荐答案

检查您的 package.config ,查看它是否具有 TechTalk.SpecFlow 的条目.如果是,则从程序包配置文件中删除该条目...以及删除与该dll相关的所有程序集.从 NuGet 重新安装特定版本,然后重新编译您的项目.

Check your package.config and see if it has an entry for TechTalk.SpecFlow. If yes, then delete the entry from package config file ... as well delete all the assembly related to that dll. Re-install the specific version from NuGet and re-compile your project.

根据您的评论,它仍然针对新版本 newVersion ="2.1.0.0" ,而不是新版本 Version = 1.9.0.77 .更改您的 app.config

Per your comment it still targeting the new version newVersion="2.1.0.0" and not the new version Version=1.9.0.77. Change your app.config like to be

<assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" /> 
<bindingRedirect oldVersion="0.0.0.0-2.1.0.0" newVersion="1.9.0.77" /> 

这篇关于Techtalk.Specflow错误:无法加载程序集文件或程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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