2009-09-16 53 views
0

我試圖在我的應用程序上實現NHaml視圖,並且它都運行正常。 但奇怪的是,當發佈應用程序時,我在web.config文件中收到了一些警告。ASP.NET MVC - web.config文件上的NHaml問題

我nhaml參數爲:

<configSections> 
    ... 
    <section name="nhaml" type="NHaml.Configuration.NHamlConfigurationSection, NHaml"/> 
</configSections> 
<nhaml autoRecompile="true" templateCompiler="CSharp3" encodeHtml="false" useTabs="false" indentSize="2"> 
    <assemblies> 
    <add assembly="MyApp"/> 
    </assemblies> 
    <namespaces> 
    <add namespace="MyApp" /> 
    <add namespace="MyApp.Controllers" /> 
    </namespaces> 
</nhaml> 

所以,它的怪異,因爲HAML意見正在沒有任何問題呈現,但每次我打開web.config文件,我得到以下警告:

Message 1 Could not find schema information for the element 'nhaml'.   C:\inetpub\MyApp\Web.config 25 4 MyApp 
Message 2 Could not find schema information for the attribute 'autoRecompile'. C:\inetpub\MyApp\Web.config 25 10 MyApp 
Message 3 Could not find schema information for the attribute 'templateCompiler'. C:\inetpub\MyApp\Web.config 25 31 MyApp 
Message 4 Could not find schema information for the attribute 'encodeHtml'.  C:\inetpub\MyApp\Web.config 25 58 MyApp 
Message 5 Could not find schema information for the attribute 'useTabs'.   C:\inetpub\MyApp\Web.config 25 77 MyApp 
Message 6 Could not find schema information for the attribute 'indentSize'.  C:\inetpub\MyApp\Web.config 25 93 MyApp 
Message 7 Could not find schema information for the element 'assemblies'.  C:\inetpub\MyApp\Web.config 26 6 MyApp 
Message 8 Could not find schema information for the element 'add'.    C:\inetpub\MyApp\Web.config 27 8 MyApp 
Message 9 Could not find schema information for the attribute 'assembly'.   C:\inetpub\MyApp\Web.config 27 12 MyApp 
Message 10 Could not find schema information for the element 'namespaces'.  C:\inetpub\MyApp\Web.config 29 6 MyApp 
Message 11 Could not find schema information for the element 'add'.    C:\inetpub\MyApp\Web.config 30 8 MyApp 
Message 12 Could not find schema information for the attribute 'namespace'.  C:\inetpub\MyApp\Web.config 30 12 MyApp 
Message 13 Could not find schema information for the element 'add'.    C:\inetpub\MyApp\Web.config 31 8 MyApp 
Message 14 Could not find schema information for the attribute 'namespace'.  C:\inetpub\MyApp\Web.config 31 12 MyApp 

我做錯了什麼?

感謝您的關注。 :)

回答

0

似乎這些只是VS告訴你,自定義元素不能在XSD內找到它認爲配置文件應該看起來像。 nhibernate也是如此。

所以你沒有做錯任何事情,你可以忽略這些信息。他們只是信息。

在此基礎上的博客文章 http://fgheysels.blogspot.com/2006/04/net-20-could-not-find-schema.html

我可以創建爲配置的nhaml XSD(以同樣的方式NHibernate的鄉親有),但它並不是我的優先事項清單。如果信息真的讓你煩惱,請隨時留言。

+0

這是一種解脫。非常感謝simon,這非常有幫助和信息。 – zanona 2009-09-20 10:51:00