473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

multiple config sections - could not create error

Geez...seems like i've compared every friggin character...works n this
programA but not n programB. I have a config file with multiple
sections and when trying to read each section, it works great in one
program and not in another. I basically copied and pasted the config
file as well as the section handlers , changed references from programA
to programB but on every section in programB I get like "Could not
create PRICING.BRASSSectionHandler,PRICING". I've verified my
namespace and assembly names are 'pricing'. Any help would be greatly
appreciated and i mean mucho! Thanks in advance..Michael

Here's the config file and associated code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section
name="BRASSSection"
type="PRICING.BRASSSectionHandler,PRICING" />
<section
name="IDCSection"
type="PRICING.IDCSectionHandler,PRICING" />
</configSections>

<appSettings>
<add key="DebugSwitch" value="N" />
</appSettings>

<BRASSSection appName="BRASS">

<InputFile>c:\Code\BatchCode\ProgramInput\BrassInp utFile.txt</InputFile>

<ProcessedSecuritiesReport>c:\Code\BatchCode\Progr amInput\BrassProcessSecurities.txt</ProcessedSecuritiesReport>

<UnProcessedSecuritiesReport>c:\Code\BatchCode\Pro gramReports\BrassUnProcessSecurities.txt</UnProcessedSecuritiesReport>
<PricingServer>I</PricingServer>

<InventoryPricingServer>204.110.192.57[5176]</InventoryPricingServer>

<ErrorPercentage>10</ErrorPercentage>
</BRASSSection>

<IDCSection appName="IDC">

<InputFile>c:\Code\BatchCode\ProgramInput\IDCInput File.txt</InputFile>

<ProcessedSecuritiesReport>c:\Code\BatchCode\Progr amInput\IDCProcessSecurities.txt</ProcessedSecuritiesReport>

<UnProcessedSecuritiesReport>c:\Code\BatchCode\Pro gramReports\IDCUnProcessSecurities.txt</UnProcessedSecuritiesReport>
<PricingServer>B</PricingServer>
<ErrorPercentage>10</ErrorPercentage>
</IDCSection>

</configuration>

Public Class BRASSSectionHandler
Implements IConfigurationSectionHandler

Public Function Create(ByVal parent As Object, _
ByVal configContext As Object, _
ByVal section As System.Xml.XmlNode) As Object _
Implements
System.Configuration.IConfigurationSectionHandler. Create

Dim data As New NameValueCollection

Dim root As XmlElement = CType(section, XmlElement)
Dim node As XmlNode

For Each node In root.ChildNodes
data.Add(node.Name, node.InnerText)
Next

'Create and return the settings container
Return New BRASSSectionData(root.GetAttribute("appName"), data)

End Function

End Class

Public Class BRASSSectionData
Private mAppName As String
Private mData As New NameValueCollection

Public ReadOnly Property AppName() As String
Get
Return mAppName
End Get
End Property

Default Public ReadOnly Property Setting(ByVal Name As String) As
String
Get
Return mData(Name)
End Get
End Property

Public Sub New(ByVal AppName As String, ByVal Data As
NameValueCollection)

mAppName = AppName
mData = Data

End Sub

End Class

Feb 17 '06 #1
0 1300

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Guinness Mann | last post by:
I'm working in VS2003.NET, with C#. I use app.config to store the connection string to my SQL Server. This works fine. Lately I've been taking work home where the connection string is...
3
by: Craig | last post by:
I've developed an single sign on web application that we'd like to use with all the applications we're developing. The application's connection string is stored in web.config. I've gotten some...
6
by: Andrew Connell | last post by:
I have an app where I want virtually everything password protected/secure except for a single directory. That directory handles some custom authentication and contains my login form, but also some...
0
by: Johannes H?drich | last post by:
Hello folks, i've got a tough problem with configuration the CMAB in my asp.net application. Following scenario is given: root directory (ASP.NET Application) |- web.config (access from CMAB...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
6
by: Tabi | last post by:
Hi, I want to create a custom section in my web.config that can hold my custom values. I created a section in web.config as written below. <configSections> <section name="myCustomSection"...
17
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
2
by: kx10 | last post by:
Hi, Is it possible to store an array of reserved numbers within appSettings in the Web.config file? I have very limited XML knowledge but am guessing I might be able to create some child nodes...
0
by: j | last post by:
I'm trying to write a section of code so that several applications that all share some configuration options can load those options from a single .config file. This code compiles and executes w/o...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.