Results 1 to 4 of 4

Thread: Reading web.config [Resolved]

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Reading web.config [Resolved]

    I'm trying to read the web.config file.

    In web.config, I have:

    Code:
    <configuration>
    	 
    <appSettings>	
    	<add key="pluto" value="blue" />
    </appSettings>
    Simple?

    I try to read it like this:

    VB Code:
    1. Dim strCustom As String
    2.         strCustom = System.Configuration.ConfigurationSettings.AppSettings("pluto").ToString

    But when I run it, it doesn't even get to the vbcode. Instead, I get an error message just as it finishes compiling:

    ---------------------------
    Microsoft Development Environment
    ---------------------------
    Error while trying to run project: Unable to start debugging on the web server. Server side-error occurred on sending debug HTTP request.

    Make sure the server is operating correctly. Verify there are no syntax errors in web.config by doing a Debug.Start Without Debugging. You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation.


    ---------------------------
    OK Help
    ---------------------------
    And if I start without debugging, it shows this:

    Parser Error Message: Unrecognized element

    Source Error:


    Line 5: <appSettings>
    Line 6: <add key="pluto" value="blue" />
    Line 7: </appSettings>
    Line 8:
    Line 9: -->


    What's wrong with me? Should I jump out a window?
    Last edited by mendhak; Jul 19th, 2004 at 12:51 AM.

  2. #2

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Don't you just hate it when you solve the problem yourself?

  3. #3
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018
    I do if the person doesn't post the answer.

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Line Number 9, in the quoted error.
    I had a --> for absolutely no reason there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width