我在家里的电脑上安装了Specflow。它在我工作的PC上完美运行。
安装Specflow后,我在家中收到此错误:
警告引用ActivityLog.xml。这是ActivityLog.xml所说的:
<entry>
<record>518</record>
<time>2018/02/28 07:40:02.966</time>
<type>Error</type>
<source>VisualStudio</source>
<description>LegacySitePackage failed for package [SpecFlowPackagePackage]Source: 'Microsoft.VisualStudio.Composition' Description: Expected 1 export(s) with contract name "TechTalk.SpecFlow.VsIntegration.LanguageService.IGherkinLanguageServiceFactory" but found 0 after applying applicable constraints.
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "TechTalk.SpecFlow.VsIntegration.LanguageService.IGherkinLanguageServiceFactory" but found 0 after applying applicable constraints.
 at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition)
 at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView](String contractName, ImportCardinality cardinality)
 at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName)
 at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T](String contractName)
 at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]()
 at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]()
 at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()
 at TechTalk.SpecFlow.VsIntegration.Utils.VsxHelper.ResolveMefDependency[T](IServiceProvider serviceProvider)
 at TechTalk.SpecFlow.VsIntegration.DefaultDependencyProvider.RegisterVsDependencies(IObjectContainer container, IServiceProvider serviceProvider)
 at TechTalk.SpecFlow.VsIntegration.DefaultDependencyProvider.RegisterDefaults(IObjectContainer container)
 at TechTalk.SpecFlow.VsIntegration.VsContainerBuilder.RegisterDefaults(IObjectContainer container)
 at TechTalk.SpecFlow.VsIntegration.VsContainerBuilder.CreateContainer(SpecFlowPackagePackage package)
 at TechTalk.SpecFlow.VsIntegration.SpecFlowPackagePackage.Initialize()
 at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsPackage.SetSite(IServiceProvider sp)</description>
<guid>{5D978B7F-8F91-41C1-B7BA-0B4C056118E8}</guid>
<hr>80131500</hr>
<errorinfo></errorinfo>
</entry>
我该如何解决这个问题?我花了很长时间谷歌搜索。例如,我看过这里:specflow disabled, SpecflowPackagePackage didnt load correctly
答案 0 :(得分:1)
请查看此问题:https://github.com/techtalk/SpecFlow/issues/1049
tl; dr:清理Visual Studio的MEF缓存并更新到VS 2017的最新版本。