Hi, I'm working on an ASP.NET web application and I have added a
custom config section to my web.config file like so:
<configuration>
<!-- Define the custom configuration sections... -->
<configSections>
<section name="MyConfig" type="IF.Config.MyConfig, IF.Config,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=a7987c61b51ca972" />
</configSections>
<MyConfig configSource="mycustomconfiguration.config" />
<system.web>
...
</system.web>
</configuration>
When I step through my code (via Microsoft Visual Studio 2005) to
submit my web form, I have no problems. However, when I compile my
code and install it on my computer, I get the following error when I
submit the form:
Exception occurred: Value does not fall within the expected range.
I've narrowed it down to the following line of code
customConfig = (MyConfig)appConfig.GetSection("MyConfig");
where customConfig is previously defined:
static MyConfig customConfig = null;
and appConfig is previously defined:
Configuration appConfig =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
The only difference between the compiled code and the code to step
through the applications is that I had to change appConfig to:
Configuration appConfig = ConfigurationManager.OpenExeConfiguration("D:
\\webapp\\IF.Web\\bin\\IF.Web.dll");
in order to step through it.
Does anyone have any suggestions? I can't figure out why it can't
find the configuration section.
thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---