Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after installing Specflow extension in VS 2022 (17.10.5) #171

Open
gopalverma opened this issue Jul 28, 2024 · 6 comments
Open

Error after installing Specflow extension in VS 2022 (17.10.5) #171

gopalverma opened this issue Jul 28, 2024 · 6 comments

Comments

@gopalverma
Copy link

Used Visual Studio

Visual Studio 2022

Are the latest Visual Studio updates installed?

Yes

SpecFlow Section in app.config or content of specflow.json

No response

Issue Description

Error after installing Specflow extension in VS 2022 (17.10.5)
Error hash: 922178479
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "SpecFlow.VisualStudio.ProjectSystem.VsIdeScope" 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.LoadProjectSystem() in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 81

Steps to Reproduce

Installed Specflow Extension > On creating a Specfow project, it threw the error pop up (attached log) > tried uninstall and reinstall but did not work
Logfile:
2024-07-28T00:27:53.092+01:00, Error@1, GetSafeLogger: Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "System.IO.Abstractions.IFileSystem" but found 2 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.GetSafeLogger(IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 47
2024-07-28T00:27:58.875+01:00, Verbose@1, LoadProjectSystem: Loading VsIdeScope...
2024-07-28T00:27:58.890+01:00, Error@1, ReportInitError: Initialization error : Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "SpecFlow.VisualStudio.ProjectSystem.VsIdeScope" 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.LoadProjectSystem() in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 81
2024-07-28T00:28:11.085+01:00, Verbose@1, RegisterMenuCommands: RegenerateAllFeatureFileCodeBehindCommand registered
2024-07-28T00:33:19.736+01:00, Error@1, GetSafeLogger: Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "System.IO.Abstractions.IFileSystem" but found 2 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.GetSafeLogger(IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 47
2024-07-28T00:33:19.745+01:00, Verbose@1, LoadProjectSystem: Loading VsIdeScope...
2024-07-28T00:33:19.758+01:00, Error@1, ReportInitError: Initialization error : Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "SpecFlow.VisualStudio.ProjectSystem.VsIdeScope" 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.LoadProjectSystem() in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 81
2024-07-28T00:33:24.689+01:00, Verbose@1, ReportError: Copy to clipboard: Error hash: 922178479
Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "SpecFlow.VisualStudio.ProjectSystem.VsIdeScope" 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.LoadProjectSystem() in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 81
2024-07-28T00:33:48.309+01:00, Verbose@1, RegisterMenuCommands: RegenerateAllFeatureFileCodeBehindCommand registered
2024-07-28T00:36:10.941+01:00, Error@1, GetSafeLogger: Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "System.IO.Abstractions.IFileSystem" but found 2 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.GetSafeLogger(IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 47
2024-07-28T00:36:10.948+01:00, Verbose@1, LoadProjectSystem: Loading VsIdeScope...
2024-07-28T00:36:10.956+01:00, Error@1, ReportInitError: Initialization error : Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "SpecFlow.VisualStudio.ProjectSystem.VsIdeScope" 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.LoadProjectSystem() in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 81
2024-07-28T00:37:19.836+01:00, Verbose@1, RegisterMenuCommands: RegenerateAllFeatureFileCodeBehindCommand registered
2024-07-28T01:33:28.396+01:00, Error@1, GetSafeLogger: Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "System.IO.Abstractions.IFileSystem" but found 2 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.GetSafeLogger(IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 47
2024-07-28T01:33:28.405+01:00, Verbose@1, LoadProjectSystem: Loading VsIdeScope...
2024-07-28T01:33:28.418+01:00, Error@1, ReportInitError: Initialization error : Microsoft.VisualStudio.Composition.CompositionFailedException: Expected 1 export(s) with contract name "SpecFlow.VisualStudio.ProjectSystem.VsIdeScope" 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.GetExportedValueT
at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetServiceT
at SpecFlow.VisualStudio.VsUtils.ResolveMefDependency[T](IServiceProvider serviceProvider) in D:\a\1\s\SpecFlow.VisualStudio.Package\VsUtils.cs:line 362
at SpecFlow.VisualStudio.ProjectSystem.VsIdeScopeLoader.LoadProjectSystem() in D:\a\1\s\SpecFlow.VisualStudio.Package\ProjectSystem\VsIdeScopeLoader.cs:line 81

Link to Repository Project

No response

@Jamie-Clayton
Copy link

Relates to #166

@Jamie-Clayton
Copy link

Relates to #171

@Jamie-Clayton
Copy link

Installing https://github.com/SpecFlowOSS/SpecFlow.VS/releases/tag/v2022.1.93-net8 does NOT fix the issue

@Jamie-Clayton
Copy link

Note the Visual Studio teams Feedback channel shows a 3 other extensions with issue in v17.10.x editions

I've also logged an issue with a parrallel fork in reqnroll/Reqnroll#220 as they have the same behaviour.

@Jamie-Clayton
Copy link

Rolled back to v17.10.4, from v17.10.5 (VS Installer limits how far you go back)
Uninstalled previous editions of SpecFlow.
Downloaded v2022 + .net 8.0 release and installed a single extension.
Restarted VS2022 multiple times.
Everything working.

@apis3445
Copy link

apis3445 commented Aug 9, 2024

I got the same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants