Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Webservice Web.Config

  • 10-01-2011 4:51pm
    #1
    Registered Users, Registered Users 2 Posts: 3,515 ✭✭✭


    I have a webservice, coded in C#, that has its own web.config file that contains appSettings for the Service. We will call the webservice "PerformTask".

    This Webservice has it's own Installer editor and the Installation has custom screens. This allows the User installing the webservice to enter in specific information that gets saved to the web.config file during the installation process.

    These appSettings are then accessed during runtime.

    The problem I have is around opening the Config File.

    The code I am using is:
    System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/PerformTask");

    The issue I am getting is, if the User decides to alter the name of the virtual directory during the installation, or manually in IIS, to "PerformTask1" the above line of code no longer works.

    I have tried using null, but this points to the root web.config.
    I have tried "/" and "~" but with no luck.

    Can anyone shed some light on possible solutions please?


Comments

  • Registered Users, Registered Users 2 Posts: 1,266 ✭✭✭Overflow


    Why don't you just store the configuration for the installation somewhere else, DB or another config file.


Advertisement