By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,971 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,971 IT Pros & Developers. It's quick & easy.

System.TypeLoadException Could not load type System.Configuration.SingleTagSectionHandler

P: n/a
This is interesting, I have attached my web.config file and the
exception I have been logging. I created a library which provide data
access to a database and a control system. The library is written in
C#. I created a small .exe file to test that the library builds
propertly from configuration and that it communicates properly. This
work great in the System.Windows.Forms. However, when I use the
library in a web enviroment things don't go so well. I copy the
unique instruction in the app.config file the the web.config file.
Bellow is the exception generated, essentially the system crashed when
it tries to load Systetem.Configuration.SingleTagSectionHandler which
I used in the web.config & app.config file.

Now WHY does the config file work in a desktop app enviroment and when
in a web enviroment I get problems! Any suggestions on how to fix the
problem would be much appreciated.

I am using the 1.1 version on the Framework.

The following is the exception which I log :

Exception: System.Configuration.ConfigurationException
Message: Exception creating section handler.
(c:\inetpub\wwwroot\VBTestSorter\web.config line 7)
Source: System.Web
at System.Web.Configuration.HttpConfigurationRecord.G etFactory(String
at System.Web.Configuration.HttpConfigurationRecord.E valuate(String
configKey, SectionRecord section)
at System.Web.Configuration.HttpConfigurationRecord.G etConfig(String
configKey, Boolean cacheResult)
at System.Web.Configuration.HttpConfigurationRecord.G etConfig(String
configKey, Boolean cacheResult)
at System.Web.HttpContext.GetConfig(String name)
at System.Web.Configuration.HttpConfigurationSystemBa se.System.Configuration.IConfigurationSystem.GetCo nfig(String
at System.Configuration.ConfigurationSettings.GetConf ig(String
at les.LoadLotDAL.Initialize()

Nested Exception

Exception: System.TypeLoadException
Message: Could not load type
System.Configuration.SingleTagSectionHandler from assembly System.Web,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.
Source: mscorlib
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Web.Configuration.HttpConfigurationRecord.G etFactory(String

This is an example of my web.config file :

<sectionGroup name="Sorter">
<section name="connectionString"
type="System.Configuration.SingleTagSectionHandler " />
<section name="sp_prefix"
type="System.Configuration.SingleTagSectionHandler " />
<section name="sp_sufix"
type="System.Configuration.SingleTagSectionHandler " />

<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHa ndler,log4net" />

<connectionString dsn="server=SQL-01;uid=sa;pwd=password;database=SorterUpgrade"
<sp_prefix insert="sp_Insert_" delete="sp_Remove_"
update="sp_Update_" select="sp_Select_" />
<sp_sufix destination="Destination" gradebutton="GradeButton"
gradename="GradeName" button="Button" lot="Lot"
nomThck="NominalThickness" nomWid="NominalWidth"
recalc="RecalcLength" run="Run"
wndThck="ThicknessWindow" wndWid="WidthWindow" master="MasterSort"
mastersort_sort="MasterSort_Sort" status="Status" state="State"
catThk="ThicknessCategory" catWid="WidthCategory"
catLen="LengthCategory" pctLen="LengthCategoryPCT"

Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.