Have been struggling to get this to work, I have a standard .NET Core API that I want to host on a remote IIS server, the issue is most of the tutorials are for ASP.NET 5/vNext and don't explain what happens once you run your dotnet publish
.
My bindings are correct but I'm not sure if i'm pointing at the right folder.
In my output folder I have publish and wwwroot as well as config.json
and some other json files. When I point IIS to the wwwroot folder I get:
502 - Web server received an invalid response while acting as a gateway or proxy server.
I get 404s if I try point it to any other folder. I have HttpPlatformHandler 1.2 installed. My project.json
is as follows:
{
"compilationOptions": {
"debugType": "portable",
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"publishOptions": {
"include": [
"wwwroot"
]
},
"dependencies": {
"Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-*",
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0-*",
"Microsoft.AspNetCore.Diagnostics": "1.0.0-*",
"Microsoft.AspNetCore.Hosting": "1.0.0-*",
"Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-*",
"Microsoft.AspNetCore.IISPlatformHandler": "1.0.0-*",
"Microsoft.AspNetCore.Mvc": "1.0.0-*",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-*",
"Microsoft.AspNetCore.StaticFiles": "1.0.0-*",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-*",
"Microsoft.Extensions.Configuration.Json": "1.0.0-*",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*",
"Microsoft.Extensions.Logging.Debug": "1.0.0-*",
"OpenIddict.Core": "1.0.0-*",
"OpenIddict.EF": "1.0.0-*",
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0-rc2-3002700"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": [
"portable-net45+wp80+win8+wpa81+dnxcore50",
"portable-net451+win8"
]
}
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-*",
"imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
}
},
"scripts": {
"postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
},
"content": [
"wwwroot",
"config.json",
"web.config"
],
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
]
}
I took elements of this sample for my project.json
.