Skip to content

Instantly share code, notes, and snippets.

@podhmo
Created December 24, 2013 03:03
Show Gist options
  • Save podhmo/8108265 to your computer and use it in GitHub Desktop.
Save podhmo/8108265 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="k" value="v"/>
</appSettings>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{89F1B53F-8309-407A-8985-6CF95B638145}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>AppSettingGettingExample</RootNamespace>
<AssemblyName>AppSettingGettingExample</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration.Abstractions">
<HintPath>..\packages\System.Configuration.Abstractions.1.1.5064.25905\lib\net45\System.Configuration.Abstractions.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Configuration.Abstractions" version="1.1.5064.25905" targetFramework="net45" />
</packages>
using System;
using System.Configuration;
namespace AppSettingGettingExample
{
class MainClass
{
public static void Main (string[] args)
{
Console.WriteLine ("Hello World!");
foreach (string k in ConfigurationManager.AppSettings) {
var v = ConfigurationManager.AppSettings [k];
Console.WriteLine ("k:{0} v:{1}", k, v);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment