Browse Source

Update the samples to target netcoreapp1.0 and use the new ASP.NET Core IIS module

pull/88/head
Kévin Chalet 10 years ago
parent
commit
454a46689c
  1. 2
      samples/Mvc.Client/Program.cs
  2. 3
      samples/Mvc.Client/Startup.cs
  3. 30
      samples/Mvc.Client/project.json
  4. 9
      samples/Mvc.Client/web.config
  5. 9
      samples/Mvc.Client/wwwroot/web.config
  6. 2
      samples/Mvc.Server/Program.cs
  7. 3
      samples/Mvc.Server/Startup.cs
  8. 26
      samples/Mvc.Server/project.json
  9. 9
      samples/Mvc.Server/web.config
  10. 9
      samples/Mvc.Server/wwwroot/web.config

2
samples/Mvc.Client/Program.cs

@ -8,7 +8,7 @@ namespace Mvc.Client {
.ConfigureLogging(options => options.AddConsole()) .ConfigureLogging(options => options.AddConsole())
.ConfigureLogging(options => options.AddDebug()) .ConfigureLogging(options => options.AddDebug())
.UseDefaultHostingConfiguration(args) .UseDefaultHostingConfiguration(args)
.UseIISPlatformHandlerUrl() .UseIISIntegration()
.UseKestrel() .UseKestrel()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();

3
samples/Mvc.Client/Startup.cs

@ -13,12 +13,9 @@ namespace Mvc.Client {
}); });
services.AddMvc(); services.AddMvc();
services.AddMvcDnx();
} }
public void Configure(IApplicationBuilder app) { public void Configure(IApplicationBuilder app) {
app.UseIISPlatformHandler();
app.UseForwardedHeaders(new ForwardedHeadersOptions { app.UseForwardedHeaders(new ForwardedHeadersOptions {
ForwardedHeaders = ForwardedHeaders.All ForwardedHeaders = ForwardedHeaders.All
}); });

30
samples/Mvc.Client/project.json

@ -1,4 +1,10 @@
{ {
"compilationOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-*", "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "0.1.0-*", "Microsoft.AspNetCore.Authentication.OpenIdConnect": "0.1.0-*",
@ -7,7 +13,7 @@
"Microsoft.AspNetCore.HttpOverrides": "1.0.0-*", "Microsoft.AspNetCore.HttpOverrides": "1.0.0-*",
"Microsoft.AspNetCore.Hosting": "1.0.0-*", "Microsoft.AspNetCore.Hosting": "1.0.0-*",
"Microsoft.AspNetCore.Mvc": "1.0.0-*", "Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Mvc.Dnx": "1.0.0-*", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*",
@ -15,11 +21,15 @@
}, },
"frameworks": { "frameworks": {
"net451": { }, "net451": {
"frameworkAssemblies": {
"System.Runtime": { "type": "build" }
}
},
"netstandardapp1.5": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.5.0-*" "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-*" }
}, },
"imports": [ "imports": [
@ -29,18 +39,10 @@
} }
}, },
"compilationOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"commands": {
"web": "Mvc.Client"
},
"content": [ "content": [
"wwwroot", "wwwroot",
"Views" "Views",
"web.config"
], ],
"exclude": [ "exclude": [

9
samples/Mvc.Client/web.config

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath=".\Mvc.Client.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>

9
samples/Mvc.Client/wwwroot/web.config

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>

2
samples/Mvc.Server/Program.cs

@ -8,7 +8,7 @@ namespace Mvc.Server {
.ConfigureLogging(options => options.AddConsole()) .ConfigureLogging(options => options.AddConsole())
.ConfigureLogging(options => options.AddDebug()) .ConfigureLogging(options => options.AddDebug())
.UseDefaultHostingConfiguration(args) .UseDefaultHostingConfiguration(args)
.UseIISPlatformHandlerUrl() .UseIISIntegration()
.UseKestrel() .UseKestrel()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();

3
samples/Mvc.Server/Startup.cs

@ -24,7 +24,6 @@ namespace Mvc.Server {
.Build(); .Build();
services.AddMvc(); services.AddMvc();
services.AddMvcDnx();
services.AddEntityFramework() services.AddEntityFramework()
.AddEntityFrameworkSqlServer() .AddEntityFrameworkSqlServer()
@ -41,8 +40,6 @@ namespace Mvc.Server {
} }
public void Configure(IApplicationBuilder app) { public void Configure(IApplicationBuilder app) {
app.UseIISPlatformHandler();
app.UseForwardedHeaders(new ForwardedHeadersOptions { app.UseForwardedHeaders(new ForwardedHeadersOptions {
ForwardedHeaders = ForwardedHeaders.All ForwardedHeaders = ForwardedHeaders.All
}); });

26
samples/Mvc.Server/project.json

@ -1,4 +1,10 @@
{ {
"compilationOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"dependencies": { "dependencies": {
"AspNet.Security.OAuth.GitHub": "1.0.0-*", "AspNet.Security.OAuth.GitHub": "1.0.0-*",
"AspNet.Security.OAuth.Introspection": "1.0.0-*", "AspNet.Security.OAuth.Introspection": "1.0.0-*",
@ -8,8 +14,8 @@
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*", "Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*", "Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNetCore.HttpOverrides": "1.0.0-*", "Microsoft.AspNetCore.HttpOverrides": "1.0.0-*",
"Microsoft.AspNetCore.Mvc.Dnx": "1.0.0-*", "Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.0.0-*", "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*", "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*", "Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*", "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*",
@ -25,9 +31,9 @@
} }
}, },
"netstandardapp1.5": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.5.0-*" "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-*" }
}, },
"imports": [ "imports": [
@ -37,19 +43,11 @@
} }
}, },
"compilationOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"commands": {
"web": "Mvc.Server"
},
"content": [ "content": [
"wwwroot", "wwwroot",
"Views", "Views",
"config.json" "config.json",
"web.config"
], ],
"exclude": [ "exclude": [

9
samples/Mvc.Server/web.config

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath=".\Mvc.Server.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>

9
samples/Mvc.Server/wwwroot/web.config

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
</configuration>
Loading…
Cancel
Save