2016-10-02 128 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> 
相關問題