Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Two different config file schemas

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
egottwald - 10 Mar 2006 17:15 GMT
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/g
ngrfconfigurationsectionsschema.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...
Kevin Spencer - 11 Mar 2006 14:04 GMT
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.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

> Does anyone know what the functions of the two config file schema
> definitions
[quoted text clipped - 14 lines]
>
> Any clarification would be appreciated...
egottwald - 13 Mar 2006 15:40 GMT
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...

=========================================

> Yes, they are for the .Net 1.1 (MSDN) and .Net 2.0 (MSDN2).
>
[quoted text clipped - 23 lines]
> >
> > Any clarification would be appreciated...

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.