我正在使用MSTest和命令行運行specflow測試。 項目建立沒有錯誤,但測試失敗,出現錯誤:Specflow + MSTest:測試失敗,錯誤爲「無法加載文件或程序集'MyPlugin.SpecFlowPlugin'或它的一個依賴項'
Class Initialization method MyProject.SpecFiles.MyFeature.FeatureSetup threw exception. TechTalk.SpecFlow.SpecFlowException: TechTalk.SpecFlow.SpecFlowException: Unable to load plugin: MyPlugin. Please check http://go.specflow.org/doc-plugins for details. ---> System.IO.FileNotFoundException: Could not load file or assembly 'MyPlugin.SpecFlowPlugin' or one of its dependencies. The system cannot find the file specified.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].
.
+++++++++++++++++++
STACK TRACE:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at TechTalk.SpecFlow.Infrastructure.RuntimePluginLoader.LoadPlugin(PluginDescriptor pluginDescriptor)
--- End of inner exception stack trace ---
at TechTalk.SpecFlow.Infrastructure.RuntimePluginLoader.LoadPlugin(PluginDescriptor pluginDescriptor)
at TechTalk.SpecFlow.Infrastructure.TestRunContainerBuilder.<>c__DisplayClass3.<LoadPlugins>b__1(PluginDescriptor pd)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.<ConcatIterator>d__71`1.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at TechTalk.SpecFlow.Infrastructure.TestRunContainerBuilder.LoadPlugins(IRuntimeConfigurationProvider configurationProvider, ObjectContainer container)
at TechTalk.SpecFlow.Infrastructure.TestRunContainerBuilder.CreateContainer(IRuntimeConfigurationProvider configurationProvider)
at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(TestRunnerKey key)
at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(TestRunnerKey key)
at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly, Boolean async)
at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner()
at MyProject.SpecFiles.MyFeature.FeatureSetup(TestContext testContext) in d:\Jenkins\workspace\MyProject\SpecFiles\MyFeature.feature.cs:line 0
任何人可以幫助我嗎?
以下行存在於App.config中'
PavelAnih