Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Wed, 27 Aug 2008 14:43:33 -0400,    group: microsoft.public.dotnet.framework        back       


Custom config sections   
all,

I am using custom config sections in my web application. I have it working 
as expected when accessed via the website. However, i would like to execute 
this via nUnit test classes.

I creatred an app.config file and named it FineUnitTests.dll.config and 
placed it if the bin forder where the unit tests are compiled to. The config 
file is below.


  <configSections>

    <!--Here we specify the type we use to map the site configuration to.-->
    <section name="FineSiteConfiguration" type="FineBLL.SiteSection"/>

  </configSections>


  <FineSiteConfiguration DefaultConnectionStringName="FineConnection"
                         title="This is the title for our site" 
AnotherValue="100">

    <Config1 Father="Scott" />

  </FineSiteConfiguration>



I get the following error when i execute the unit test

FineUnitTests.Learn.SiteSectionTest : System.TypeInitializationException : 
The type initializer for 'FineBLL.Application' threw an exception.
  ----> System.Configuration.ConfigurationErrorsException : An error 
occurred creating the configuration section handler for 
FineSiteConfiguration: Could not load type 'FineBLL.SiteSection' from 
assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'. 
(C:\KI\FineStationery\FineMid\FineUnitTests\bin\Debug\FineUnitTests.dll.config 
line 8)
  ----> System.TypeLoadException : Could not load type 'FineBLL.SiteSection' 
from assembly 'System.Configuration, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'.


any help would be appreciated.
date: Wed, 27 Aug 2008 14:43:33 -0400   author:   scott ocamb

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us