Could not find schema information for the element

J

Jeff

Hi

asp.net 3.5

I'm trying to add a custom section to web.config, but get many messages when
I compile the code:

I get 5 messages about "could not find schema":
Could not find schema information for the element 'testgroup'.
Could not find schema information for the element 'testsystem'.
Could not find schema information for the attribute
'defaultConnectionStringName'.
Could not find schema information for the element 'test'.

<configuration>
<configSections>
<sectionGroup name="testgroup">
<section name="testsystem" type="AH.Test.TestSection"/>
</sectionGroup>
</configSections>

<testgroup>
<testsystem defaultConnectionStringName="LocalSqlServer">
<test providerType="AH.Test.DAL.Sql2005Express.TestProvider" />
</testsystem>
</testgroup>

namespace AH.Test
{
public class TestSection : ConfigurationSection
{
[ConfigurationProperty("defaultConnectionStringName", DefaultValue =
"LocalSqlServer")]
public string DefaultConnectionStringName
{
get { return (string)base["defaultConnectionStringName"]; }
set { base["defaultConnectionStringName"] = value; }
}


[ConfigurationProperty("test", IsRequired = true)]
public TestElement Test
{
get { return (TestElement)base["test"]; }
}
}

public class TestElement : ConfigurationElement
{
public TestElement() { }

[ConfigurationProperty("connectionStringName")]
public string ConnectionStringName
{
get { return (string)base["connectionStringName"]; }
set { base["connectionStringName"] = value; }
}

public string ConnectionString
{
get
{
string connStringName =
(string.IsNullOrEmpty(this.ConnectionStringName) ?
Globals.Settings.DefaultConnectionStringName :
this.ConnectionStringName);
return
WebConfigurationManager.ConnectionStrings[connStringName].ConnectionString;
}
}
}
}

any suggestion?
 
E

Eliyahu Goldin

All these <testxxx> elements are apparently made by you. And you didn't
include them in the schema used for validation, did you? Obviously, you
can't expect VS to validate the xml after this. Just ignore these messages.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top