Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web config

Status
Not open for further replies.

sodakotahusker

Programmer
Joined
Mar 15, 2001
Messages
601
I learned from an example how to pull a value out of web.config to be able to store my connection string in a central location - in a childroot named <appsettings>

I was assuming that I can put whatever I want in there and there is no finite list of things that belong there?

Based on that assumption I put some other home grown values in there like the URL for my home page etc. It works fine on my local dev machine but when I try to run with that config on my web provider - it throws an error - which it won't display to me because it says I need to set the customer error handler to OFF (which I did - I thought).

Anybody have a clue what I need to do here - or if my primary assumption is inaccurate - pop my bubble please.
 
I was assuming that I can put whatever I want in there and there is no finite list of things that belong there?

You are pretty much correct. The problem will almost certainly lie in another area. Have you tried using a custom error page or removing certain parts of the config file so you could narrow the problem down?

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
I just remove the two new appsettings that I use on my local machine and then it works again.
I have not taken time to create custom errors.
 
The appSettings section is made up of NameValuePairs, so the settings must be added in the form of:
Code:
<add key="MySettingKey" value="MySettingValue" />

You can also create your own custom config sections, if you need more than a simple name/value pair.

[pipe]
 
Ah hah. I thought it was working on my own machine until I fired up the app tonight. APparently it was using the old config all the time yesterday. I had copied in the new keys and had pasted in front of the original closing />
Now it is working on both home and the web host. Thanks for the input guys!!
 
here is a follow up question,
I have been try to use System.Configuration.SingleTagSectionHandler and I get hit with.

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Exception creating section handler.

Source Error:


Line 4: <configSections>
Line 5: <section name="MySingleTagSection"
Line 6: type="System.Configuration.SingleTagSectionHandler,
Line 7: Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

Source File: c:\inetpub\ Line: 6

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Version=1.0.5000.0' could not be loaded.


=== Pre-bind state information ===
LOG: DisplayName = Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Partial)
LOG: Appbase = file:///c:/inetpub/LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a


my web.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<configSections>
<section name="MySingleTagSection"
type="System.Configuration.SingleTagSectionHandler,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
....


The Version, Culture and PublicKeyToken are the machine.config
<add assembly="System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

Any help appreciated.
Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top