1. <small id='nSfwC'></small><noframes id='nSfwC'>

      <i id='nSfwC'><tr id='nSfwC'><dt id='nSfwC'><q id='nSfwC'><span id='nSfwC'><b id='nSfwC'><form id='nSfwC'><ins id='nSfwC'></ins><ul id='nSfwC'></ul><sub id='nSfwC'></sub></form><legend id='nSfwC'></legend><bdo id='nSfwC'><pre id='nSfwC'><center id='nSfwC'></center></pre></bdo></b><th id='nSfwC'></th></span></q></dt></tr></i><div id='nSfwC'><tfoot id='nSfwC'></tfoot><dl id='nSfwC'><fieldset id='nSfwC'></fieldset></dl></div>
      <legend id='nSfwC'><style id='nSfwC'><dir id='nSfwC'><q id='nSfwC'></q></dir></style></legend>

      1. <tfoot id='nSfwC'></tfoot>
        • <bdo id='nSfwC'></bdo><ul id='nSfwC'></ul>

      2. 如何为 web/app.config 架构制作扩展 xsd?

        时间:2023-06-04

          <i id='LPGHc'><tr id='LPGHc'><dt id='LPGHc'><q id='LPGHc'><span id='LPGHc'><b id='LPGHc'><form id='LPGHc'><ins id='LPGHc'></ins><ul id='LPGHc'></ul><sub id='LPGHc'></sub></form><legend id='LPGHc'></legend><bdo id='LPGHc'><pre id='LPGHc'><center id='LPGHc'></center></pre></bdo></b><th id='LPGHc'></th></span></q></dt></tr></i><div id='LPGHc'><tfoot id='LPGHc'></tfoot><dl id='LPGHc'><fieldset id='LPGHc'></fieldset></dl></div>
          <legend id='LPGHc'><style id='LPGHc'><dir id='LPGHc'><q id='LPGHc'></q></dir></style></legend>

            <bdo id='LPGHc'></bdo><ul id='LPGHc'></ul>

            <small id='LPGHc'></small><noframes id='LPGHc'>

            • <tfoot id='LPGHc'></tfoot>

                    <tbody id='LPGHc'></tbody>
                1. 本文介绍了如何为 web/app.config 架构制作扩展 xsd?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  如何为自定义配置部分创建架构?我尝试制作一个,但当我使用它时,它说唯一预期的元素是我在该架构中拥有的元素,并抱怨标准的 web.config 东西,即使我仍在使用普通的 DotNetConfig.xsd 文件也是如此.

                  解决方案

                  我发现的这个问题不是重复的,但是解决方案会解决你的问题:

                  How do I make a schema for custom config sections? I tried making one, but when I used it, it said the only expected element was what I had in that schema, and complained about the standard web.config stuff, even though I was still using the normal DotNetConfig.xsd file too.

                  解决方案

                  This question I found isn't duplicate, but the solution will solve your problem:

                  How to fix Error: "Could not find schema information for the attribute/element" by creating schema

                  The trick is to get the "Properties" of the app.config editor, and set the Schemas value:

                  • Right Click -> Properties anywhere in the XML file editor, or just hit F4 while it is in focus
                  • In that dialog, add a local or absolute reference to a schema file

                  My app.config file's properties window/gadget looks like this:

                  Here's an example I just got working (I'm toying around with Ninject and NLog). The elements and attributes under the nlog section show up correctly in Intellisense, and I get squiggly lines if I violate the schema.

                  <?xml version="1.0"?>
                  <configuration>
                    <configSections>
                      <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
                    </configSections>
                    <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                      <targets>
                        <target name="eventLog" xsi:type="EventLog" log="Application"
                                category="TestService" />
                        <target name="file" xsi:type="File"
                                layout="${longdate}|${stacktrace}|${message}"
                                fileName="${logger}.txt" />
                      </targets>
                      <rules>
                        <logger name="*" minlevel="Info" writeTo="eventLog" />
                        <logger name="*" minlevel="Debug" writeTo="file"/>
                      </rules>
                    </nlog>
                    <startup>
                      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
                    </startup>
                  </configuration>
                  

                  My schema file is in my project root, right next to app.config, and called NLog.xsd. I simply saved it from here:

                  • http://nlog-project.org/schemas/NLog.xsd

                  这篇关于如何为 web/app.config 架构制作扩展 xsd?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 Visual Studio IDE 中从 XSD 自动生成 C# 下一篇:如何将 XSD 文件转换为 C# 类

                  相关文章

                  最新文章

                  • <bdo id='kiAfc'></bdo><ul id='kiAfc'></ul>

                  1. <small id='kiAfc'></small><noframes id='kiAfc'>

                    <tfoot id='kiAfc'></tfoot>
                    <i id='kiAfc'><tr id='kiAfc'><dt id='kiAfc'><q id='kiAfc'><span id='kiAfc'><b id='kiAfc'><form id='kiAfc'><ins id='kiAfc'></ins><ul id='kiAfc'></ul><sub id='kiAfc'></sub></form><legend id='kiAfc'></legend><bdo id='kiAfc'><pre id='kiAfc'><center id='kiAfc'></center></pre></bdo></b><th id='kiAfc'></th></span></q></dt></tr></i><div id='kiAfc'><tfoot id='kiAfc'></tfoot><dl id='kiAfc'><fieldset id='kiAfc'></fieldset></dl></div>

                    <legend id='kiAfc'><style id='kiAfc'><dir id='kiAfc'><q id='kiAfc'></q></dir></style></legend>