Skip to main content
All CollectionsTroubleshooting
Specflow: System.Exception Unit Test Provider Already Set
Specflow: System.Exception Unit Test Provider Already Set

Troubleshooting report generation in SpecFlow

Alan Parkinson avatar
Written by Alan Parkinson
Updated over 3 years ago

When trying to configure SpecFlow to generate a test results report file for publishing to Behave Pro you might receive this error:

The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.System.Exception: Unit test Provider already set.at TechTalk.SpecFlow.UnitTestProvider.UnitTestProviderConfiguration.UseUnitTestProvider(String unitTestProviderName)

This error indicates that your SpecFlow solution is configured to use xUnit or Nunit to execute your SpecFlow tests. These test runners can not generate custom reports that can be consumed by BDD tools.
โ€‹
Our solution for generating the JSON report from SpecFlow uses SpecFlow+, a dedicated test runner for SpecFlow that replaces the need for xUnit and Nunit. SpecFlow+ has a number of other advantages and we recommend teams consider switching to it.
โ€‹
Without using SpecFlow+ isn't possible to publish test results to Behave Pro or other BDD tools

Did this answer your question?