Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to get values from app.connfig when there is a web reference?

How to get values from app.connfig when there is a web reference?

Scheduled Pinned Locked Moved C#
helpcsharptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sampath Jayasinghe
    wrote on last edited by
    #1

    Hi, I added a web reference and I wanted to dynamically get the link. So I thought to store it in the app.config as shown below. When I tried to read it from the below shown C# code it returns a null value. app.config C# code string WsUrl = ConfigurationManager.AppSettings["ABC"].ToString(); Does anybody know how to fix it? Any help would be great! Rgds, Sampathg

    D 1 Reply Last reply
    0
    • S sampath Jayasinghe

      Hi, I added a web reference and I wanted to dynamically get the link. So I thought to store it in the app.config as shown below. When I tried to read it from the below shown C# code it returns a null value. app.config C# code string WsUrl = ConfigurationManager.AppSettings["ABC"].ToString(); Does anybody know how to fix it? Any help would be great! Rgds, Sampathg

      D Offline
      D Offline
      Davide Icardi
      wrote on last edited by
      #2

      I think that if you are writing a Web Services you need a Web.config not App.Config. Try to rename the file to Web.config Davide

      S 1 Reply Last reply
      0
      • D Davide Icardi

        I think that if you are writing a Web Services you need a Web.config not App.Config. Try to rename the file to Web.config Davide

        S Offline
        S Offline
        sampath Jayasinghe
        wrote on last edited by
        #3

        Davide, First of all thanks a lot for helping.. I tried that too. But the result is the same. Any other suggestions? Rgds, Sampath

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups