Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 28th, 2006, 06:34 AM
Authorized User
 
Join Date: Mar 2006
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.

 
Old November 28th, 2006, 12:56 PM
Authorized User
 
Join Date: May 2006
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.

 
Old November 28th, 2006, 05:02 PM
Authorized User
 
Join Date: Mar 2006
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?

 
Old November 28th, 2006, 05:23 PM
Authorized User
 
Join Date: May 2006
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.

 
Old November 29th, 2006, 04:37 AM
Authorized User
 
Join Date: Mar 2006
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.

 
Old November 29th, 2006, 11:16 AM
Authorized User
 
Join Date: Mar 2006
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.

 
Old November 29th, 2006, 12:01 PM
Authorized User
 
Join Date: May 2006
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)...


 
Old November 29th, 2006, 12:26 PM
Authorized User
 
Join Date: Mar 2006
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.






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





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