|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Two different config file schemasDoes anyone know what the functions of the two config file schema definitions
at: [1] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfconfigurationsectionsschema.asp and: [2] http://msdn2.microsoft.com/en-us/library/1fk1t1t0(VS.80).aspx are? I originally assumed that [2] was for VS 2005 / Framework 2.0, but when I used it in an application I C++ am writing using VS 2005 , I got a bazillion XML errors - all of the form: "Could not find schema information for the element 'zzz' " where zzz is one of the elements defined by the schema [e.g., supportedRuntime ] so now I'm thoroughly confused. Any clarification would be appreciated... Yes, they are for the .Net 1.1 (MSDN) and .Net 2.0 (MSDN2).
The .Net platform 2.0 uses XSD files to validate the configuration files at design time. You weren't specific about what sections you got validation errors on. However, I can tell you that if, for example, you use custom configuration sections, and don't use the right XSD for validation, you will get warnings about those sections. It doesn't necessarily mean that they will not work for you. -- Show quoteHTH, Kevin Spencer Microsoft MVP ..Net Developer Presuming that God is "only an idea" - Ideas exist. Therefore, God exists. "egottwald" <egottw***@discussions.microsoft.com> wrote in message news:400B5983-0B6F-4771-B662-B64434E216DA@microsoft.com... > Does anyone know what the functions of the two config file schema > definitions > at: > > [1] > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfconfigurationsectionsschema.asp > > and: > > [2] http://msdn2.microsoft.com/en-us/library/1fk1t1t0(VS.80).aspx > > are? I originally assumed that [2] was for VS 2005 / Framework 2.0, but > when I used it in an application I C++ am writing using VS 2005 , I got a > bazillion XML errors - all of the form: "Could not find schema information > for the element 'zzz' " where zzz is one of the elements defined by the > schema [e.g., supportedRuntime ] so now I'm thoroughly confused. > > Any clarification would be appreciated... > > Thanks, that's what I thought. However, what I don't understand is why the
validation errors occurred under VS 2005 / Framework 2.0 [the section of current focus is the AppSettings, though I got error on "supportedRuntime " as well]. How do I make sure that the 'right' XSD is used? I' trying to use a very straightforward [IMHO] app.config file structure that looks like: <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup> <supportedRuntime version="v2.0.50727"/> </startup> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.50727, Culture=neutral, PublicKeyToken=null" > <section name="WhoIsLoggedOn.ServerNames" type="System.Configuration.ConfigurationManager.AppSettings, System, Version=2.0.50727, Culture=neutral, PublicKeyToken=null" /> </sectionGroup> </configSections> <applicationSettings> <WhoIsLoggedOn.ServerNames> <setting name="Server1" serializeAs="String"> <value>aaaaa</value> </setting> <setting name="Server2" serializeAs="String"> <value>bbbbb <setting name="Server3" serializeAs="String"> <value>ccccc</value> </setting> <setting name="Server4" serializeAs="String"> <value>ddddd</value> </setting> <setting name="Server5" serializeAs="String"> <value>???</value> </setting> </WhoIsLoggedOn.ServerNames> </applicationSettings> </configuration> ========================================= but can't get it to work. If I run ignoring the validation errors, I get a value of 0 for AppSettings.Count so am at a loss to understand what's going on. I must admit that I have a workaround working sing the 'old style' cofig file structure - i.e., <add key="Server1" value="aaaaa" />... works just fine. I'd like to be able to leverage the increased flexibility in other apps, so would like to be able to get it to work. TFYH... ========================================= Show quote "Kevin Spencer" wrote: > Yes, they are for the .Net 1.1 (MSDN) and .Net 2.0 (MSDN2). > > The .Net platform 2.0 uses XSD files to validate the configuration files at > design time. You weren't specific about what sections you got validation > errors on. However, I can tell you that if, for example, you use custom > configuration sections, and don't use the right XSD for validation, you will > get warnings about those sections. It doesn't necessarily mean that they > will not work for you. > > -- > HTH, > > Kevin Spencer > Microsoft MVP > ..Net Developer > > Presuming that God is "only an idea" - > Ideas exist. > Therefore, God exists. > > "egottwald" <egottw***@discussions.microsoft.com> wrote in message > news:400B5983-0B6F-4771-B662-B64434E216DA@microsoft.com... > > Does anyone know what the functions of the two config file schema > > definitions > > at: > > > > [1] > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfconfigurationsectionsschema.asp > > > > and: > > > > [2] http://msdn2.microsoft.com/en-us/library/1fk1t1t0(VS.80).aspx > > > > are? I originally assumed that [2] was for VS 2005 / Framework 2.0, but > > when I used it in an application I C++ am writing using VS 2005 , I got a > > bazillion XML errors - all of the form: "Could not find schema information > > for the element 'zzz' " where zzz is one of the elements defined by the > > schema [e.g., supportedRuntime ] so now I'm thoroughly confused. > > > > Any clarification would be appreciated... > > > > > > > |
|||||||||||||||||||||||