Issue #1311: Samples should be able to run on Mono.

Fix: Adding support for Kestrel server and fixing the paths for mono.
This commit is contained in:
sornaks 2014-10-17 13:42:31 -07:00
parent 5119d16b64
commit 99ad37fa99
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
using System;
using System.IO;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Razor;
@ -21,8 +22,9 @@ namespace MvcSample.Web
{
app.UseFileServer();
#if ASPNET50
// We use Path.Combine here so that it works on platforms other than Windows as well.
var configuration = new Configuration()
.AddJsonFile(@"App_Data\config.json")
.AddJsonFile(Path.Combine("App_Data", "config.json"))
.AddEnvironmentVariables();
string diSystem;

View File

@ -3,6 +3,7 @@
"warningsAsErrors": true
},
"dependencies": {
"Kestrel": "1.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.IIS": "1.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
@ -10,7 +11,10 @@
"Microsoft.DataAnnotations": "1.0.0-*",
"Microsoft.Framework.ConfigurationModel": "1.0.0-*"
},
"commands": { "web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001" },
"commands": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001",
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5000"
},
"frameworks": {
"aspnet50": {
"dependencies": {