Browse Source

React to API changes in aspnet/Hosting

1c70ff4d13
pull/41/head
Kévin Chalet 11 years ago
parent
commit
ec34de7724
  1. 10
      samples/Mvc.Client/Startup.cs
  2. 3
      samples/Mvc.Client/hosting.json
  3. 7
      samples/Mvc.Client/project.json
  4. 10
      samples/Mvc.Server/Startup.cs
  5. 3
      samples/Mvc.Server/hosting.json
  6. 6
      samples/Mvc.Server/project.json

10
samples/Mvc.Client/Startup.cs

@ -1,6 +1,7 @@
using Microsoft.AspNet.Authentication;
using Microsoft.AspNet.Authentication.Cookies;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.HttpOverrides;
using Microsoft.Extensions.DependencyInjection;
@ -9,6 +10,15 @@ using Microsoft.IdentityModel.Protocols.OpenIdConnect;
namespace Mvc.Client {
public class Startup {
public static void Main(string[] args) {
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
public void ConfigureServices(IServiceCollection services) {
services.Configure<SharedAuthenticationOptions>(options => {
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;

3
samples/Mvc.Client/hosting.json

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

7
samples/Mvc.Client/project.json

@ -7,6 +7,7 @@
"Microsoft.AspNet.Authentication.OpenIdConnect": "1.0.0-*",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNet.HttpOverrides": "1.0.0-*",
"Microsoft.AspNet.Hosting": "1.0.0-*",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNet.StaticFiles": "1.0.0-*",
@ -16,8 +17,12 @@
"Newtonsoft.Json": "7.0.1"
},
"compilationOptions": {
"emitEntryPoint": true
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
"web": "Mvc.Client"
},
"frameworks": {

10
samples/Mvc.Server/Startup.cs

@ -1,6 +1,7 @@
using System.Linq;
using CryptoHelper;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.HttpOverrides;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Data.Entity;
@ -14,6 +15,15 @@ using OpenIddict.Models;
namespace Mvc.Server {
public class Startup {
public static void Main(string[] args) {
var application = new WebApplicationBuilder()
.UseConfiguration(WebApplicationConfiguration.GetDefault(args))
.UseStartup<Startup>()
.Build();
application.Run();
}
public void ConfigureServices(IServiceCollection services) {
var configuration = new ConfigurationBuilder()
.AddJsonFile("config.json")

3
samples/Mvc.Server/hosting.json

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

6
samples/Mvc.Server/project.json

@ -22,8 +22,12 @@
"OpenIddict": "1.0.0-*"
},
"compilationOptions": {
"emitEntryPoint": true
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
"web": "Mvc.Server"
},
"frameworks": {

Loading…
Cancel
Save