2016-10-02 50 views
1

我正在使用Specflow时,正确的测试它刚刚停止与下面的错误工作:我试着回滚我的变化,我仍然得到相同的。Specflow生成错误 - 无法识别的属性'属性'

我也重新安装specflow并完全删除mt nuget包并将其恢复。不用找了。

当试图建立我的项目,它已经specflow我得到了我所有的.feature文件以下错误:

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

而且在我的功能文件运行specflow定制工具,我得到上述错误也。

NCRunch也抱怨specflows的MSBuild XML文件,并出现以下错误信息:

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

回答

1

我发现这个问题与我的应用程序配置做。出于某种原因,它改变为如下:

<?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> 

需要改变两个属性属性名称:

<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> 
相关问题