Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 28th, 2006, 06:34 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Configuration Module

Hi,

I have been using the code with this book to create my own CMS. I have copied the code 99%. However I am getting the following problem.

An error occurred creating the configuration section handler for xxxCMS: Could not load type 'xxxCMS.ConfigSection' from assembly '__code'.

<configSections>
<section name="xxxCMS" type="xxxCMS.ConfigSection, __code"/>
</configSections>

This occurs when i try to interact with the database.

Could someone help me please, I am hoping it is only something small.

  #2 (permalink)  
Old November 28th, 2006, 12:56 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

Do you have the xxxCMS section following the configSections? It should look something similar to this:

<xxxCMS ...>
...
</xxxCMS>

If you haven't renamed the section from the Beerhouse example then that is the problem.

  #3 (permalink)  
Old November 28th, 2006, 05:02 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much for your reply.

I do have the following

<xxxCMS defaultConnectionStringName="LocalSqlServer">

</xxxCMS>

Any ideas what else it could be?

  #4 (permalink)  
Old November 28th, 2006, 05:23 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

Make sure your Globals.Settings (in App_Code) property is pointing to the correct section.

If you're early on in the book, and haven't got the SQL database set up then remove the defaultConnectionStringName parameter from the section.

  #5 (permalink)  
Old November 29th, 2006, 04:37 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Forgive my ignorance, but how i do locate the property you speak of?

I tried removing " defaultConnectionStringName="LocalSqlServer" but still same problem.

Thanks.

  #6 (permalink)  
Old November 29th, 2006, 11:16 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I uderstand what you mean now. The following is the code I have from the Globals.cs file in App_Code

namespace xxxCMS.DAL
{
    public static class Globals
    {
        public readonly static xxxCMSConfigSection Settings = (xxxCMSConfigSection)WebConfigurationManager.GetSe ction("xxxCMS");
        public static string ThemesSelectorID = "";

        static Globals()
        {

        }
    }
}

I think i have this coded correctly.

Still getting the same error though.

  #7 (permalink)  
Old November 29th, 2006, 12:01 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

You actually have two problems:

One is your Globals namespace, because the Globals class isn't a DAL class.

Second is definition of Settings. You should change it to:
   public readonly static ConfigSection Settings = (ConfigSection)...


  #8 (permalink)  
Old November 29th, 2006, 12:26 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The incorrect namespace was the problem.

The second point you made only created another problem for me so I returned that to its original.

Thanks for your help, much appreciated.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Module Creation Problem SandersM Access VBA 2 June 19th, 2007 12:18 PM
Configuration Problem r_taduri ASP.NET 2.0 Basics 1 September 25th, 2006 07:12 AM
Module News Problem thanhh83 BOOK: ASP.NET Website Programming Problem-Design-Solution 9 May 16th, 2006 09:41 PM
problem with forum module anass BOOK: ASP.NET Website Programming Problem-Design-Solution 2 August 8th, 2005 01:47 AM
Module Configuration shylockmccoy BOOK: ASP.NET Website Programming Problem-Design-Solution 0 February 24th, 2004 04:24 PM



All times are GMT -4. The time now is 10:45 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.