Home
Options

ConfigurationManager.AppSettings on LinqPad 8

I have a problem with the read of configurationmanager.appsettings, I want to debug with LINQPad 8 a program with a DLL library that I create. The problem is that the DLL library take a URL of a webserver from the config file (app.config if is a desktop software or web.config if it's a web app) but I don't know how to do this in linqpad 8.

In my DLL I use this instruction to take the URL of webserver (after I call the API from this URL):

string url = ConfigurationManager.AppSettings["Url"];

How can i create a fake app.config or web.config for using ConfigurationManager.AppSettings?
Thanks much.

Comments

  • Options

    I'm not sure that I fully the question. If you want to ensure that a .app.config or .web.config file is present in the output folder so that your code can read it, just press F4 and add a reference to that file. LINQPad copies anything that you reference (including config files) into the output folder.

  • Options

    I have to say, I had no idea the Query Properties panel could reference anything other than assemblies/libraries.

Sign In or Register to comment.