This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = new ConfigurationBuilder() | |
.AddJsonFile("appsettings.json") | |
.build(); | |
var host = new WebHostBuilder() | |
.UseConfiguration(config.GetSection("Hosting")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AppSettings": { | |
"Setting1": "value1", | |
"Setting2": "value2" | |
}, | |
"Hosting": { | |
"urls": "https://*:5000", | |
"environment": "Production" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) .NET Foundation. All rights reserved. | |
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | |
namespace Microsoft.AspNetCore.Hosting | |
{ | |
public static class WebHostDefaults | |
{ | |
public static readonly string ApplicationKey = "applicationName"; | |
public static readonly string StartupAssemblyKey = "startupAssembly"; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void Main(string[] args) | |
{ | |
var config = new ConfigurationBuilder() | |
.AddJsonFile("hosting.json", optional: true) | |
.AddCommandLine(args) | |
.Build(); | |
var host = new WebHostBuilder() | |
.UseConfiguration(config) | |
.UseKestrel() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp2.0</TargetFramework> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | |
<DefineConstants>TRACE;DEBUG;ASSERT;NETCOREAPP2_0</DefineConstants> | |
</PropertyGroup> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp2.0</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170601-03" /> | |
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" /> | |
<PackageReference Include="xunit" Version="2.3.0-beta3-build3705" /> |
NewerOlder