Skip to content

Commit

Permalink
React to API changes in aspnet/Hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Dec 22, 2015
1 parent 330178c commit ec34de7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
10 changes: 10 additions & 0 deletions samples/Mvc.Client/Startup.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -9,6 +10,15 @@

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;
Expand Down
3 changes: 3 additions & 0 deletions samples/Mvc.Client/hosting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}
7 changes: 6 additions & 1 deletion samples/Mvc.Client/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -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-*",

Expand All @@ -16,8 +17,12 @@
"Newtonsoft.Json": "7.0.1"
},

"compilationOptions": {
"emitEntryPoint": true
},

"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
"web": "Mvc.Client"
},

"frameworks": {
Expand Down
10 changes: 10 additions & 0 deletions samples/Mvc.Server/Startup.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -14,6 +15,15 @@

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")
Expand Down
3 changes: 3 additions & 0 deletions samples/Mvc.Server/hosting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"server": "Microsoft.AspNet.Server.Kestrel"
}
6 changes: 5 additions & 1 deletion samples/Mvc.Server/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
"OpenIddict": "1.0.0-*"
},

"compilationOptions": {
"emitEntryPoint": true
},

"commands": {
"web": "Microsoft.AspNet.Server.Kestrel"
"web": "Mvc.Server"
},

"frameworks": {
Expand Down

2 comments on commit ec34de7

@sashasochka
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does "web": "Mvc.Server" work? Isn't Mvc.Server a namespace? In my project it doesn't work if I use "web": "my_project_namespace", with my_project_namespace containing Startup class. I'm using the latest dnx.

@kevinchalet
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the new hosting model, it must correspond to your project name (not the namespace of your Startup class).

Please sign in to comment.