Reputation: 15787
I have installed Specflow on my PC at home. It works perfectly on my PC at work.
After installing Specflow I get this error at home:
The warning references ActivityLog.xml. Here is what ActivityLog.xml says:
<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>
How can I fix this? I have spent a long time Googling. For example, I have looked here: specflow disabled, SpecflowPackagePackage didnt load correctly
Upvotes: 1
Views: 1097
Reputation: 5825
Please have a look at this issue: https://github.com/techtalk/SpecFlow/issues/1049
tl;dr: cleanup the MEF cache of Visual Studio and update to the latest version of VS 2017.
Upvotes: 1