Wil
Wil

Reputation: 544

Specflow Generation Errors - Unrecognised attribute 'property'

I was working with Specflow when halfway through righting a test it just stopped working with the errors below: I have tried rolling my changes back and I still get the same.

I have also reinstalled specflow and completely removed mt nuget packages and restored them. No change.

When trying to build my project which has specflow in it I get the following errors on all of my .feature files:

#error Generation error: SpecFlow configuration error -> Unrecognized attribute 'property'. Note that attribute names are case-sensitive.

Also running the specflow custom tool on my feature files I get the above error also.

NCRunch is also complaining about specflows MSBuild XML files with the following error message:

..\packages\SpecFlow.2.1.0\tools\TechTalk.SpecFlow.targets (47, 5): SpecFlow configuration error

Upvotes: 1

Views: 525

Answers (1)

Wil
Wil

Reputation: 544

I found the problem was to do with my app config. For some reason it changed to the following:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section property="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
  </configSections>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity property="FakeItEasy" publicKeyToken="eff28e2146d5fd2c" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.2.0.0" newVersion="2.2.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity property="Autofac" publicKeyToken="17863af14b0044da" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

  <specFlow>
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
    <unitTestProvider property="xUnit" />
  </specFlow>


</configuration>

Needed to change the two property attributes to name:

  <configSections>
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
  </configSections>


  <specFlow>
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
    <unitTestProvider name="xUnit" />
  </specFlow>

Upvotes: 1

Related Questions