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

P

phillip

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.GetFactory(String
configKey)
at System.Web.Configuration.HttpConfigurationRecord.Evaluate(String
configKey, SectionRecord section)
at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String
configKey, Boolean cacheResult)
at System.Web.Configuration.HttpConfigurationRecord.GetConfig(String
configKey, Boolean cacheResult)
at System.Web.HttpContext.GetConfig(String name)
at System.Web.Configuration.HttpConfigurationSystemBase.System.Configuration.IConfigurationSystem.GetConfig(String
configKey)
at System.Configuration.ConfigurationSettings.GetConfig(String
sectionName)
at Hinz.WeyerChem.Sorter.DataAccessLayer.Database.tables.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.GetFactory(String
configKey)




This is an example of my web.config file :

<configSections>
<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" />

</sectionGroup>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>

<Sorter>
<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"
sort="Sort"
mastersort_sort="MasterSort_Sort" status="Status" state="State"
species="Species"
catThk="ThicknessCategory" catWid="WidthCategory"
pctWid="WidthCategroyPCT"
catLen="LengthCategory" pctLen="LengthCategoryPCT"
catGrd="GradeCategory"
pctGrd="GradeCategoryPCT"/>


</soreter
<log4net>

......
</log4net>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top