PC Review


Reply
Thread Tools Rate Thread

Could not find schema information for the element

 
 
Jeff
Guest
Posts: n/a
 
      4th Mar 2008
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?


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      5th Mar 2008
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


"Jeff" <no_email_address> wrote in message
news:(E-Mail Removed)...
> 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?
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
could not find schema information policyinjection joyce Microsoft Dot NET Framework 0 11th Jul 2007 02:45 PM
Could not find schema information in app.config jhansen Microsoft C# .NET 0 15th Jun 2006 06:14 PM
Could not find schema information =?Utf-8?B?RGVyZWs=?= Microsoft ASP .NET 0 14th Mar 2006 10:42 AM
ASP.NET 2.0 : compile error : Could not find schema information John A Grandy Microsoft ASP .NET 1 2nd Nov 2005 07:20 PM
per the active schema, the element <BR> must be included within a parent element MSNews Microsoft ASP .NET 1 22nd Apr 2004 05:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:57 AM.