w0051977
w0051977

Reputation: 15787

Cannot install and use Specflow

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:

enter image description here

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: &apos;Microsoft.VisualStudio.Composition&apos; Description: Expected 1 export(s) with contract name &quot;TechTalk.SpecFlow.VsIntegration.LanguageService.IGherkinLanguageServiceFactory&quot; but found 0 after applying applicable constraints.&#x000D;&#x000A;Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name &quot;TechTalk.SpecFlow.VsIntegration.LanguageService.IGherkinLanguageServiceFactory&quot; but found 0 after applying applicable constraints.&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExports(ImportDefinition importDefinition)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExports[T,TMetadataView](String contractName, ImportCardinality cardinality)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T,TMetadataView](String contractName)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T](String contractName)&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExport[T]()&#x000D;&#x000A;   at Microsoft.VisualStudio.Composition.ExportProvider.GetExportedValue[T]()&#x000D;&#x000A;   at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()&#x000D;&#x000A;   at TechTalk.SpecFlow.VsIntegration.Utils.VsxHelper.ResolveMefDependency[T](IServiceProvider serviceProvider)&#x000D;&#x000A;   at TechTalk.SpecFlow.VsIntegration.DefaultDependencyProvider.RegisterVsDependencies(IObjectContainer container, IServiceProvider serviceProvider)&#x000D;&#x000A;   at TechTalk.SpecFlow.VsIntegration.DefaultDependencyProvider.RegisterDefaults(IObjectContainer container)&#x000D;&#x000A;   at TechTalk.SpecFlow.VsIntegration.VsContainerBuilder.RegisterDefaults(IObjectContainer container)&#x000D;&#x000A;   at TechTalk.SpecFlow.VsIntegration.VsContainerBuilder.CreateContainer(SpecFlowPackagePackage package)&#x000D;&#x000A;   at TechTalk.SpecFlow.VsIntegration.SpecFlowPackagePackage.Initialize()&#x000D;&#x000A;   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

Answers (1)

Andreas Willich
Andreas Willich

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

Related Questions