web.config 파일의 asp.net mvc -nhaml 문제
-
07-07-2019 - |
문제
응용 프로그램에서 NHAML보기를 구현하려고 노력하고 있으며 모두 잘 작동합니다. 그러나 이상하게도 응용 프로그램을 게시 할 때 Web.config 파일에 대한 경고를 받고 있습니다.
내 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
내가 뭔가 잘못하고 있습니까?
관심을 가져 주셔서 감사합니다. :)
해결책
XSD 내부에서는 구성 파일이 어떻게 보일지 생각하는 것에 대해 사용자 정의 요소를 찾을 수 없다고 말하는 것입니다. nhibernate에서도 마찬가지입니다.
그래서 당신은 잘못된 일을하지 않고 메시지를 무시할 수 있습니다. 그들은 단지 정보입니다.
이 블로그 게시물을 기반으로합니다http://fgheysels.blogspot.com/2006/04/net-20-could-not-find-schema.html
구성을위한 NHAML XSD를 만들 수 있지만 (NHibernate 사람들이 가진 것과 마찬가지로) 우선 순위 목록에서는 높지 않습니다. 메시지가 실제로 당신을 괴롭 히면 자유롭게 갈 수 있습니다.
제휴하지 않습니다 StackOverflow