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 / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

Could not find schema information for the element

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff - 04 Mar 2008 17:40 GMT
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?
Eliyahu Goldin - 05 Mar 2008 09:36 GMT
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.

Signature

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

> Hi
>
[quoted text clipped - 69 lines]
>
> any suggestion?

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.