React to hosting changes - updated samples

This commit is contained in:
Ajay Bhargav Baaskaran 2015-12-18 15:30:52 -08:00
parent 00722ce91a
commit 9517de1c45
29 changed files with 212 additions and 71 deletions

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace ActionConstraintSample.Web namespace ActionConstraintSample.Web
@ -25,5 +26,15 @@ namespace ActionConstraintSample.Web
routes.MapRoute("default", "{controller}/{action}"); routes.MapRoute("default", "{controller}/{action}");
}); });
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,15 +1,16 @@
{ {
"commands": { "compilationOptions": {
"web": "Microsoft.AspNet.Server.Kestrel", "emitEntryPoint": true
"weblistener": "Microsoft.AspNet.Server.WebListener" },
}, "commands": {
"dependencies": { "web": "ActionConstraintSample.Web"
"Microsoft.AspNet.Mvc": "6.0.0-*", },
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "dependencies": {
"Microsoft.AspNet.Server.WebListener": "1.0.0-*" "Microsoft.AspNet.Mvc": "6.0.0-*",
}, "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"frameworks": { },
"dnx451": { }, "frameworks": {
"dnxcore50": { } "dnx451": { },
} "dnxcore50": { }
}
} }

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace CustomRouteSample.Web namespace CustomRouteSample.Web
@ -22,5 +23,15 @@ namespace CustomRouteSample.Web
routes.MapRoute("default", "{controller}/{action}"); routes.MapRoute("default", "{controller}/{action}");
}); });
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,12 +1,13 @@
{ {
"compilationOptions": {
"emitEntryPoint": true
},
"commands": { "commands": {
"web": "Microsoft.AspNet.Server.Kestrel", "web": "CustomRouteSample.Web"
"weblistener": "Microsoft.AspNet.Server.WebListener"
}, },
"dependencies": { "dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"Microsoft.AspNet.Server.WebListener": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": { },

View File

@ -4,6 +4,7 @@
using System.Reflection; using System.Reflection;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.FileProviders; using Microsoft.AspNet.FileProviders;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc.Razor; using Microsoft.AspNet.Mvc.Razor;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -37,5 +38,15 @@ namespace EmbeddedViewSample.Web
new { controller = "Home", action = "Index" }); new { controller = "Home", action = "Index" });
}); });
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,14 +1,15 @@
{ {
"compilationOptions": {
"emitEntryPoint": true
},
"commands": { "commands": {
"web": "Microsoft.AspNet.Server.Kestrel", "web": "EmbeddedViewSample.Web"
"weblistener": "Microsoft.AspNet.Server.WebListener"
}, },
"resource": "EmbeddedResources/**", "resource": "EmbeddedResources/**",
"dependencies": { "dependencies": {
"Microsoft.AspNet.FileProviders.Embedded": "1.0.0-*", "Microsoft.AspNet.FileProviders.Embedded": "1.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"Microsoft.AspNet.Server.WebListener": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": { },

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc; using Microsoft.AspNet.Mvc;
using Microsoft.AspNet.Mvc.Formatters; using Microsoft.AspNet.Mvc.Formatters;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -33,5 +34,15 @@ namespace FormatFilterSample.Web
{ {
app.UseMvc(); app.UseMvc();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,12 +1,13 @@
{ {
"compilationOptions": {
"emitEntryPoint": true
},
"commands": { "commands": {
"web": "Microsoft.AspNet.Server.Kestrel", "web": "FormatFilterSample.Web"
"weblistener": "Microsoft.AspNet.Server.WebListener"
}, },
"dependencies": { "dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"Microsoft.AspNet.Server.WebListener": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": { },

View File

@ -3,6 +3,7 @@
using InlineConstraintSample.Web.Constraints; using InlineConstraintSample.Web.Constraints;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Localization; using Microsoft.AspNet.Localization;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -34,5 +35,15 @@ namespace InlineConstraintSample.Web
app.UseMvc(); app.UseMvc();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,15 +1,16 @@
{ {
"commands": { "compilationOptions": {
"web": "Microsoft.AspNet.Server.Kestrel", "emitEntryPoint": true
"weblistener": "Microsoft.AspNet.Server.WebListener" },
}, "commands": {
"dependencies": { "web": "InlineConstraintSample.Web"
"Microsoft.AspNet.Mvc": "6.0.0-*", },
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "dependencies": {
"Microsoft.AspNet.Server.WebListener": "1.0.0-*" "Microsoft.AspNet.Mvc": "6.0.0-*",
}, "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"frameworks": { },
"dnx451": { }, "frameworks": {
"dnxcore50": { } "dnx451": { },
} "dnxcore50": { }
}
} }

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace JsonPatchSample.Web namespace JsonPatchSample.Web
@ -20,5 +21,15 @@ namespace JsonPatchSample.Web
// Add MVC to the request pipeline // Add MVC to the request pipeline
app.UseMvc(); app.UseMvc();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,12 +1,13 @@
{ {
"compilationOptions": {
"emitEntryPoint": true
},
"commands": { "commands": {
"web": "Microsoft.AspNet.Server.Kestrel", "web": "JsonPatchSample.Web"
"weblistener": "Microsoft.AspNet.Server.WebListener"
}, },
"dependencies": { "dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"Microsoft.AspNet.Server.WebListener": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": { },

View File

@ -4,6 +4,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Localization; using Microsoft.AspNet.Localization;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -39,5 +40,15 @@ namespace LocalizationSample.Web
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,12 +1,13 @@
{ {
"commands": { "commands": {
"web": "Microsoft.AspNet.Server.Kestrel", "web": "LocalizationSample.Web"
"weblistener": "Microsoft.AspNet.Server.WebListener" },
"compilationOptions": {
"emitEntryPoint": true
}, },
"dependencies": { "dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"Microsoft.AspNet.Server.WebListener": "1.0.0-*"
}, },
"frameworks": { "frameworks": {
"dnx451": { }, "dnx451": { },

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -28,5 +29,15 @@ namespace MvcSandbox
template: "{controller=Home}/{action=Index}/{id?}"); template: "{controller=Home}/{action=Index}/{id?}");
}); });
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -1,9 +1,9 @@
{ {
"commands": { "commands": {
"web": "Microsoft.AspNet.Server.Kestrel", "web": "MvcSandbox"
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000"
}, },
"compilationOptions": { "compilationOptions": {
"emitEntryPoint": true,
"warningsAsErrors": true "warningsAsErrors": true
}, },
"dependencies": { "dependencies": {
@ -12,7 +12,6 @@
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-*", "Microsoft.AspNet.Tooling.Razor": "1.0.0-*",
"Microsoft.Extensions.Configuration.Json": "1.0.0-*", "Microsoft.Extensions.Configuration.Json": "1.0.0-*",
@ -31,6 +30,5 @@
"publishExclude": [ "publishExclude": [
"**.user", "**.user",
"**.vspscc" "**.vspscc"
], ]
"webroot": "wwwroot"
} }

View File

@ -3,6 +3,7 @@
using System; using System;
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using TagHelperSample.Web.Services; using TagHelperSample.Web.Services;
@ -32,5 +33,15 @@ namespace TagHelperSample.Web
app.UseMvcWithDefaultRoute(); app.UseMvcWithDefaultRoute();
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,18 +1,17 @@
{ {
"commands": {
"web": "Microsoft.AspNet.Hosting server=Microsoft.AspNet.Server.WebListener server.urls=http://localhost:5001/taghelpers",
"kestrel": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --server.urls http://localhost:5000"
},
"compilationOptions": { "compilationOptions": {
"emitEntryPoint": true,
"warningsAsErrors": true "warningsAsErrors": true
}, },
"commands": {
"web": "TagHelperSample.Web"
},
"dependencies": { "dependencies": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*",
"Microsoft.AspNet.Diagnostics": "1.0.0-*", "Microsoft.AspNet.Diagnostics": "1.0.0-*",
"Microsoft.AspNet.Mvc": "6.0.0-*", "Microsoft.AspNet.Mvc": "6.0.0-*",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*", "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-*",
"Microsoft.AspNet.Server.WebListener": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*", "Microsoft.AspNet.StaticFiles": "1.0.0-*",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-*" "Microsoft.AspNet.Tooling.Razor": "1.0.0-*"
}, },
@ -28,6 +27,5 @@
"publishExclude": [ "publishExclude": [
"**.user", "**.user",
"**.vspscc" "**.vspscc"
], ]
"webroot": "wwwroot"
} }

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNet.Builder; using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc.Routing; using Microsoft.AspNet.Mvc.Routing;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
@ -33,5 +34,15 @@ namespace UrlHelperSample.Web
routes.MapRoute("Default", "{controller=Home}/{action=Index}"); routes.MapRoute("Default", "{controller=Home}/{action=Index}");
}); });
} }
public static void Main(string[] args)
{
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
} }
} }

View File

@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}

View File

@ -1,15 +1,16 @@
{ {
"commands": { "compilationOptions": {
"weblistener": "Microsoft.AspNet.Server.WebListener", "emitEntryPoint": true
"web": "Microsoft.AspNet.Server.Kestrel" },
}, "commands": {
"dependencies": { "web": "UrlHelperSample.Web"
"Microsoft.AspNet.Mvc": "6.0.0-*", },
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*", "dependencies": {
"Microsoft.AspNet.Server.WebListener": "1.0.0-*" "Microsoft.AspNet.Mvc": "6.0.0-*",
}, "Microsoft.AspNet.Server.Kestrel": "1.0.0-*"
"frameworks": { },
"dnx451": { }, "frameworks": {
"dnxcore50": { } "dnx451": { },
} "dnxcore50": { }
}
} }