Specflow: could not find a data exchange file at the path System.Configuration.ConfigurationErrorsException: SpecFlow configuration error

Created on 5 Apr 2019  Â·  5Comments  Â·  Source: SpecFlowOSS/SpecFlow

SpecFlow Version:

  • [x] 3.0
  • [ ] 2.4
  • [ ] 2.3
  • [ ] 2.2
  • [ ] 2.1
  • [ ] 2.0
  • [ ] 1.9

Used Test Runner

  • [x] SpecFlow+Runner
  • [ ] MSTest
  • [ ] NUnit
  • [ ] Xunit


Version number:

Visual Studio Version

  • [ ] VS 2019
  • [x] VS 2017
  • [ ] VS 2015
  • [ ] VS 2013

Are the latest Visual Studio updates installed?

  • [x] Yes
  • [ ] No

.NET Framework:

  • [ ] >= .NET 4.5
  • [ ] before .NET 4.5
  • [ ] .NET Core 2.0
  • [x] .NET Core 2.1
  • [ ] .NET Core 2.2
  • [ ] .NET Core 3.0

Test Execution Method:

  • [x] Visual Studio Test Explorer
  • [ ] TFS/VSTS/Azure DevOps – Task – PLEASE SPECIFY THE NAME OF THE TASK
  • [ ] Command line – PLEASE SPECIFY THE FULL COMMAND LINE

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

Issue Description


feature file
Feature: SpecFlowFeature2
In order to avoid silly mistakes
As a math idiot
I want to be told the sum of two numbers

@mytag
Scenario: Add two numbers
Given I have entered 50 into the calculator
And I have entered 70 into the calculator
When I press add
Then the result should be 120 on the screen

SpecFlowFeature2.cs
We could not find a data exchange file at the path System.Configuration.ConfigurationErrorsException: SpecFlow configuration error ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.

Please open an issue at https://github.com/techtalk/SpecFlow/issues/
Complete output:
System.Configuration.ConfigurationErrorsException: SpecFlow configuration error ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Configuration.ConfigurationSection.DeserializeSection(XmlReader reader)
at TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler.CreateFromXml(String xmlContent)
at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProvider.GetPlugins(SpecFlowConfigurationHolder configurationHolder)
--- End of inner exception stack trace ---
at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProvider.GetPlugins(SpecFlowConfigurationHolder configurationHolder)
at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.LoadPlugins(ObjectContainer container, IGeneratorConfigurationProvider configurationProvider, SpecFlowConfigurationHolder configurationHolder)
at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.CreateContainer(SpecFlowConfigurationHolder configurationHolder, ProjectSettings projectSettings)
at TechTalk.SpecFlow.Generator.TestGeneratorFactory.CreateGenerator(ProjectSettings projectSettings)
at TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.Actions.GenerateTestFileAction.GenerateTestFile(GenerateTestFileParameters opts)

Error in Console :
(1:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'Feature: SpecFlowFeature1' Test C:\Users\sitpxs\source\repos\Test\Test\Feature\SpecFlowFeature2.feature 1

Command: c:\users\sitpxs\appdata\local\microsoft\visualstudio\15.0_70f6a7f0\extensions\l1w5dt35.h0e\TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.exe
Parameters: GenerateTestFile --featurefile C:\Users\sitpxs\AppData\Local\Temp\tmpA047.tmp --outputdirectory C:\Users\sitpxs\AppData\Local\Temp --projectsettingsfile C:\Users\sitpxs\AppData\Local\Temp\tmpA046.tmp
Working Directory:

Steps to Reproduce

Generator Question

All 5 comments

Something is wrong in your app.config.

Hi @PriyaSolanke286 first of all apart from your actual issue, you’re using English in your feature files and specifying Gherkin dialect as deutsch-Austrian. Make it en-US

thanks.. issue is resolved

Glad to help :)

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings