none
How you dynamically set the Web Reference URL after the solution is published? RRS feed

  • Question

  • I have developed Excel 2010 addin that has a web reference.

    The URL Behaviour is set to Dynamic which means, I believe, that I can set the Web Reference URL in the app.config file. How do I change that dynamically after it has been deployed at a client?

    The addin is to be distributed to multiple clients who have different URLS to their web servers.

    With SOAP it was possible to just dynamically set the c_WSDL_URL as part of the SOAP initialisation; as the Excel addin was starting it would read the web service url from the registry (where it was written to during the install)  and use that in the initialisation of the web service call. Is it possible to do something similar with a Visual Studio Web Reference?

    If after the solution is published and the user installs on their pc do they then have an app.settings file somewhere?

    This is my first VSTO project so I'm obviously missing some important step.

    Thanks

    Saturday, March 12, 2011 7:01 PM

Answers

  • Hi MerlinXL,

    Thanks for posting in the MSDN Forum.

    Do you set the URL in the Resources of the app.config file? If it is, you are able to access it like this snippet:

    String path = Properties.Resources.URL;
    

    I hope it helps.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 14, 2011 3:29 AM
    Moderator