Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#配置App.config以指定环境_C#_App Config - Fatal编程技术网

C#配置App.config以指定环境

C#配置App.config以指定环境,c#,app-config,C#,App Config,我已从Github从以下位置下载了一个C#页面对象项目: 程序使用app.config文件标识要加载的页面对象 我想做的是:配置app.config文件以参数化测试环境。当前,当我想要更改测试环境时,我会搜索并替换app.config文件中的每个url字符串,直到所有url指向适当的测试环境。相反,我希望有一个参数,我可以设置它指向适当的测试环境 下面的app.config文件示例 提前谢谢 <configuration> <configSections> &

我已从Github从以下位置下载了一个C#页面对象项目:

程序使用app.config文件标识要加载的页面对象

我想做的是:配置app.config文件以参数化测试环境。当前,当我想要更改测试环境时,我会搜索并替换app.config文件中的每个url字符串,直到所有url指向适当的测试环境。相反,我希望有一个参数,我可以设置它指向适当的测试环境

下面的app.config文件示例

提前谢谢

<configuration>
  <configSections>
    <section name="Environments" type="NASOnline_TestFramework.Setup.EnvironmentsDataSection, NASOnline_TestFramework" />
  </configSections>

 <Environments>
    <!--STAGE-->
    <Environment>
      <add name="LoginPage" url="https://svcrel.wn.nasinsurance.com" pageTitle="NAS Insurance Services, Inc." />

      <!--Service Center Pages-->

      <add name="LandingPage" url="https://svcrel.wn.nasinsurance.com/index.php?c=home.updates" pageTitle="NAS Insurance Services, Inc." />
      <add name="ApplicationsPage" url="https://svcrel.wn.nasinsurance.com/index.php?c=app_list.list" pageTitle="NAS Insurance Services, Inc." />
      <add name="PoliciesPage" url="https://svcrel.wn.nasinsurance.com/index.php?c=policy_list.list" pageTitle="NAS Insurance Services, Inc." />
      <add name="ClientsPage" url="https://svcrel.wn.nasinsurance.com/index.php?c=insured_list.list" pageTitle="NAS Insurance Services, Inc." />