Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2467 from NancyFx/coreclr
Browse files Browse the repository at this point in the history
Merge coreclr branch into master (attempt 2)
  • Loading branch information
jchannon committed May 27, 2016
2 parents f8c79f5 + 301d1d0 commit a9989a6
Show file tree
Hide file tree
Showing 180 changed files with 4,755 additions and 1,826 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ Gemfile.lock
packages/
project.lock.json
TestAssembly.dll
.vscode/
9 changes: 9 additions & 0 deletions Nancy.Next.sln
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Nancy.ViewEngines.Razor.Tes
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Nancy.ViewEngines.Razor.Tests.Models", "test\Nancy.ViewEngines.Razor.Tests.Models\Nancy.ViewEngines.Razor.Tests.Models.xproj", "{31FA18D3-24AD-4AB0-B297-5A2FD871989E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{AA791E28-7914-439A-B59A-580B8D8FE95D}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Nancy.Demo.Hosting.Kestrel", "samples\Nancy.Demo.Hosting.Kestrel\Nancy.Demo.Hosting.Kestrel.xproj", "{9921E059-612B-4011-9AB6-FD30E69850A1}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Nancy.Tests.Functional", "test\Nancy.Tests.Functional\Nancy.Tests.Functional.xproj", "{742AC687-FC9A-4534-BB50-3D91738563A7}"
EndProject
Global
Expand Down Expand Up @@ -230,6 +234,10 @@ Global
{31FA18D3-24AD-4AB0-B297-5A2FD871989E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31FA18D3-24AD-4AB0-B297-5A2FD871989E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31FA18D3-24AD-4AB0-B297-5A2FD871989E}.Release|Any CPU.Build.0 = Release|Any CPU
{9921E059-612B-4011-9AB6-FD30E69850A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9921E059-612B-4011-9AB6-FD30E69850A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9921E059-612B-4011-9AB6-FD30E69850A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9921E059-612B-4011-9AB6-FD30E69850A1}.Release|Any CPU.Build.0 = Release|Any CPU
{742AC687-FC9A-4534-BB50-3D91738563A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{742AC687-FC9A-4534-BB50-3D91738563A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{742AC687-FC9A-4534-BB50-3D91738563A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -274,6 +282,7 @@ Global
{C46BFAA7-F471-45A6-A5AC-FCF9390408EE} = {F44224E5-8E58-4D52-A0F0-BCBA2ADC0A0B}
{A24271FA-E058-42E0-BB7D-3C8C43DF4B04} = {F44224E5-8E58-4D52-A0F0-BCBA2ADC0A0B}
{31FA18D3-24AD-4AB0-B297-5A2FD871989E} = {F44224E5-8E58-4D52-A0F0-BCBA2ADC0A0B}
{9921E059-612B-4011-9AB6-FD30E69850A1} = {AA791E28-7914-439A-B59A-580B8D8FE95D}
{742AC687-FC9A-4534-BB50-3D91738563A7} = {F44224E5-8E58-4D52-A0F0-BCBA2ADC0A0B}
EndGlobalSection
EndGlobal
45 changes: 45 additions & 0 deletions Nancy.Next.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/ExcludedFiles/FileMasksToSkip/=_002A_002Ecshtml/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeTypeMemberModifiers/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeTypeModifiers/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=BuiltInTypeReferenceStyle/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FBuiltInTypes/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FElsewhere/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestVarOrType_005FSimpleTypes/@EntryIndexedValue">WARNING</s:String>
<s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=NancyStandard/@EntryIndexedValue">&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Profile name="NancyStandard"&gt;&lt;CSUseVar&gt;&lt;BehavourStyle&gt;CAN_CHANGE_TO_IMPLICIT&lt;/BehavourStyle&gt;&lt;LocalVariableStyle&gt;ALWAYS_IMPLICIT&lt;/LocalVariableStyle&gt;&lt;ForeachVariableStyle&gt;ALWAYS_IMPLICIT&lt;/ForeachVariableStyle&gt;&lt;/CSUseVar&gt;&lt;CSOptimizeUsings&gt;&lt;OptimizeUsings&gt;True&lt;/OptimizeUsings&gt;&lt;EmbraceInRegion&gt;False&lt;/EmbraceInRegion&gt;&lt;RegionName&gt;&lt;/RegionName&gt;&lt;/CSOptimizeUsings&gt;&lt;CSReformatCode&gt;True&lt;/CSReformatCode&gt;&lt;CSShortenReferences&gt;True&lt;/CSShortenReferences&gt;&lt;CSReorderTypeMembers&gt;True&lt;/CSReorderTypeMembers&gt;&lt;CSMakeFieldReadonly&gt;True&lt;/CSMakeFieldReadonly&gt;&lt;/Profile&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/ThisQualifier/INSTANCE_MEMBERS_QUALIFY_MEMBERS/@EntryValue">All</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue">NEXT_LINE</s:String>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AROUND_SINGLE_LINE_AUTO_PROPERTY/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AROUND_SINGLE_LINE_FIELD/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AROUND_SINGLE_LINE_INVOCABLE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AROUND_SINGLE_LINE_PROPERTY/@EntryValue">1</s:Int64>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FIXED_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOR_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_FOREACH_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_IFELSE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_USING_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/FORCE_WHILE_BRACES_STYLE/@EntryValue">ALWAYS_ADD</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/INITIALIZER_BRACES/@EntryValue">NEXT_LINE</s:String>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_CODE/@EntryValue">1</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue">1</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/LINE_FEED_AT_FILE_END/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/REDUNDANT_THIS_QUALIFIER_STYLE/@EntryValue">ALWAYS_USE</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AFTER_TYPECAST_PARENTHESES/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_AROUND_MULTIPLICATIVE_OP/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_SIZEOF_PARENTHESES/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_BEFORE_TYPEOF_PARENTHESES/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/STICK_COMMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/QualifiedUsingAtNestedScope/@EntryValue">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=MethodPropertyEvent/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="Aa_bb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:String x:Key="/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue">&lt;data&gt;&lt;IncludeFilters /&gt;&lt;ExcludeFilters /&gt;&lt;/data&gt;</s:String>
<s:String x:Key="/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue">&lt;data /&gt;</s:String>
</wpf:ResourceDictionary>

4 changes: 4 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<configuration>
<packageSources>
<!-- add key="CoreCLR Xunit" value="https://www.myget.org/F/coreclr-xunit/api/v3/index.json" / -->
<!-- add key="AspNet CI Feed" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" /> -->
<add key="myget.org xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" />
<add key="dotnet.myget.org dotnet-cli" value="https://dotnet.myget.org/F/dotnet-cli/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
128 changes: 48 additions & 80 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
function Install-Dnvm
function Install-Dotnet
{
& where.exe dnvm 2>&1 | Out-Null
if(($LASTEXITCODE -ne 0) -Or ((Test-Path Env:\APPVEYOR) -eq $true))
& where.exe dotnet 2>&1 | Out-Null

if(($LASTEXITCODE -ne 0) -Or ((Test-Path Env:\APPVEYOR) -eq $true))
{
Write-Host "Dotnet CLI not found - downloading latest version"

# Prepare the dotnet CLI folder
$env:DOTNET_INSTALL_DIR="$(Convert-Path "$PSScriptRoot")\.dotnet\win7-x64"
if (!(Test-Path $env:DOTNET_INSTALL_DIR))
{
Write-Host "DNVM not found"
&{$Branch='dev';iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
}

# Normally this happens automatically during install but AppVeyor has
# an issue where you may need to manually re-run setup from within this process.
if($env:DNX_HOME -eq $NULL)
{
Write-Host "Initial DNVM environment setup failed; running manual setup"
$tempDnvmPath = Join-Path $env:TEMP "dnvminstall"
$dnvmSetupCmdPath = Join-Path $tempDnvmPath "dnvm.ps1"
& $dnvmSetupCmdPath setup
}
# Download the dotnet CLI install script
if (!(Test-Path .\dotnet\install.ps1))
{
Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1" -OutFile ".\.dotnet\dotnet-install.ps1"
}

# Run the dotnet CLI install
& .\.dotnet\dotnet-install.ps1

# Add the dotnet folder path to the process. This gets skipped
# by Install-DotNetCli if it's already installed.
Remove-PathVariable $env:DOTNET_INSTALL_DIR
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"

}
}

function Get-DnxVersion
function Remove-PathVariable
{
$globalJson = join-path $PSScriptRoot "global.json"
$jsonData = Get-Content -Path $globalJson -Raw | ConvertFrom-JSON
return $jsonData.sdk.version
[cmdletbinding()]
param([string] $VariableToRemove)
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
}

function Restore-Packages
{
param([string] $DirectoryName)
& dnu restore --quiet ("""" + $DirectoryName + """")
}

function Pack-Projects
{
param([string] $DirectoryName, [string] $Configuration)
& dnu pack --quiet ("""" + $DirectoryName + """") --configuration $Configuration --out .\artifacts\packages; if($LASTEXITCODE -ne 0) { exit 2 }
& dotnet restore -v Warning ("""" + $DirectoryName + """")
}

function Test-Projects
{
& dnx test; if($LASTEXITCODE -ne 0) { exit 3 }
}

function Remove-PathVariable
{
param([string] $VariableToRemove)
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User")
$path = [Environment]::GetEnvironmentVariable("PATH", "Process")
$newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove }
[Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process")
& dotnet test -c Release;
if($LASTEXITCODE -ne 0)
{
exit 3
}
}

########################
Expand All @@ -59,55 +63,19 @@ function Remove-PathVariable

Push-Location $PSScriptRoot

$dnxVersion = Get-DnxVersion

if (!$env:CONFIGURATION)
{
$env:CONFIGURATION = "Release"
}

# Clean
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse }

# Remove the installed DNVM from the path and force use of
# per-user DNVM (which we can upgrade as needed without admin permissions)
Remove-PathVariable "*Program Files\Microsoft DNX\DNVM*"

# Make sure per-user DNVM is installed
Install-Dnvm

# Install DNX
dnvm install $dnxVersion -r CoreCLR -NoNative
dnvm install $dnxVersion -r CLR -NoNative

# Start with regular CLR
dnvm use $dnxVersion -r CLR
# Install Dotnet CLI
Install-Dotnet

# Package restore
Write-Host "Running package restore"
Get-ChildItem -Path . -Filter *.xproj -Recurse | ForEach-Object { Restore-Packages $_.DirectoryName }

# Set build number
$env:DNX_BUILD_VERSION = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
Write-Host "Build number: " $env:DNX_BUILD_VERSION

# Package
Get-ChildItem -Path .\src -Filter *.xproj -Recurse | ForEach-Object { Pack-Projects $_.DirectoryName $env:CONFIGURATION }

# Test
# Tests
Write-Host "Running tests"
Get-ChildItem -Path .\test -Filter *.xproj -Exclude Nancy.ViewEngines.Razor.Tests.Models.xproj -Recurse | ForEach-Object {
Push-Location $_.DirectoryName
Test-Projects $_.DirectoryName
Test-Projects
Pop-Location
}

# Switch to Core CLR
#dnvm use $dnxVersion -r CoreCLR

# Test again
# Get-ChildItem -Path .\test -Filter *Tests.xproj -Recurse | ForEach-Object {
# Push-Location $_.DirectoryName
# Test-Projects $_.DirectoryName
# Pop-Location
# }
}

Pop-Location
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test", "samples" ],
"sdk": {
"version": "1.0.0-rc1-update1"
"version": "1.0.0-preview1-002702"
}
}
29 changes: 29 additions & 0 deletions samples/Nancy.Demo.Hosting.Kestrel/AppConfiguration.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace Nancy.Demo.Hosting.Kestrel
{
public class AppConfiguration
{
public Logging Logging { get; set; }
public Smtp Smtp { get; set; }
}

public class LogLevel
{
public string Default { get; set; }
public string System { get; set; }
public string Microsoft { get; set; }
}

public class Logging
{
public bool IncludeScopes { get; set; }
public LogLevel LogLevel { get; set; }
}

public class Smtp
{
public string Server { get; set; }
public string User { get; set; }
public string Pass { get; set; }
public string Port { get; set; }
}
}
24 changes: 24 additions & 0 deletions samples/Nancy.Demo.Hosting.Kestrel/DemoBootstrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace Nancy.Demo.Hosting.Kestrel
{
using System;

public class DemoBootstrapper : DefaultNancyBootstrapper
{
public DemoBootstrapper()
{

}

public DemoBootstrapper(AppConfiguration appConfig)
{
/*
We could register appConfig as an instance in the container which can
be injected into areas that need it or we could create our own INancyEnvironment
extension and use that.
*/
Console.WriteLine(appConfig.Smtp.Server);
Console.WriteLine(appConfig.Smtp.User);
Console.WriteLine(appConfig.Logging.IncludeScopes);
}
}
}
14 changes: 14 additions & 0 deletions samples/Nancy.Demo.Hosting.Kestrel/HomeModule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Nancy.Demo.Hosting.Kestrel
{
using System.Threading.Tasks;

public class HomeModule : NancyModule
{
public HomeModule()
{
Get("/", (args, ct) => Task.FromResult("Hello from Nancy running on CoreCLR"));

Get("/conneg/{name}", (args, token) => Task.FromResult(new Person() { Name = args.name }));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>9921e059-612b-4011-9ab6-fd30e69850a1</ProjectGuid>
<RootNamespace>Nancy.Demo.Hosting.Kestrel</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
7 changes: 7 additions & 0 deletions samples/Nancy.Demo.Hosting.Kestrel/Person.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Nancy.Demo.Hosting.Kestrel
{
public class Person
{
public string Name { get; set; }
}
}
20 changes: 20 additions & 0 deletions samples/Nancy.Demo.Hosting.Kestrel/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Nancy.Demo.Hosting.Kestrel
{
using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;

public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseKestrel()
.UseStartup<Startup>()
.Build();

host.Run();
}
}
}
Loading

0 comments on commit a9989a6

Please sign in to comment.