Could not find schema information for the element

  • Thread starter Thread starter Jeff
  • Start date Start date
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?
 
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
 
Back
Top