ASP NET 5 Web Application Deployment on IIS - iis

I'm trying to deploy an ASP NET 5 Web App on IIS but there´s no way to make it works, it gives me the following error:
Failed to resolve the following dependencies for target framework
'DNX,Version=v4.5.1': ....(a list with all the dependencies of my
project)
It seems thats is unable to resolve the path to the dependencies, but if I check on 'approot' folder they are all there.
My 'project.json' is this:
"dependencies": {
"EntityFramework": "7.0.0-beta4",
"EntityFramework.Commands": "7.0.0-beta4",
"EntityFramework.Core": "7.0.0-beta4",
"EntityFramework.SqlServer": "7.0.0-beta4",
"Microsoft.AspNet.Mvc": "6.0.0-beta4",
"Microsoft.AspNet.Server.IIS": "1.0.0-beta4",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta4",
"Microsoft.AspNet.StaticFiles": "1.0.0-beta4",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
"Newtonsoft.Json": "7.0.1",
"System.Xml.XmlDocument": "4.0.0-beta-22816"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": { }
}
Also the paths from web.config in 'wwwroot' folder seems to be ok:
<appSettings>
<add key="bootstrapper-version" value="1.0.0-beta4" />
<add key="runtime-path" value="..\approot\packages" />
<add key="dnx-version" value="1.0.0-beta4" />
<add key="dnx-clr" value="clr" />
<add key="dnx-app-base" value="..\approot\src\Astarte" />
</appSettings>
I'm really stucked, ¿any idea of what could be the problem?

You may need to specify the version of the sdk you require (in your case 1.0.0-beta4). Try adding a global.json file in your appication root with the following:
{
"sdk": { "version": "1.0.0-beta4" }
}
*On a side note, as #Henk Mollema has said you should probably upgrade at some point to a more recent beta, as beta4 is now quite old. Please beware however that this will cause breaking changes so you may want to tackle this separately!

Related

HTTP Error 502.3 - Bad Gateway Error returned while IIS Express is starting on Windows 10 - ASP.NET RC1 (update 2) MVC 6 web application

I have the following issue while trying to start IIS Express using Visual Studio Professional 2015 to run an ASP.NET 5 MVC 6 web application - DNX RC1 (Update 2) on Windows 10:
Error Returned:
HTTP Error 502.3 - Bad Gateway
The specified CGI application encountered an error and the server terminated the process.
Most likely causes:
- The CGI application did not return a valid set of HTTP errors.
- A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.
Detailed Error Information:
- Module: httpPlatformHandler
- Notification: ExecuteRequestHandler
- Handler: httpPlatformHandler
- Error Code: 0x80072ee2
The curious thing is that I started the same web application in a different operating system (Windows 7) and IDE (Visual Studio Community 2015). For this case I have no issues and web application runs properly. And I make sure to configure the same DNX as active on both operating systems (6.0.0-rc1-final). The only thing that vary is the framework architecture (Windows 7 =[x64] / Windows 10 =[x86]).
Down below I am also providing relevant configuration files to complement findings:
1. project.json
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"EntityFramework.Commands": "7.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"AutoMapper": "4.2.1"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {
"dependencies": {
"AutoMapper": "4.2.1",
"System.Net.Http": "4.0.1-rc2-24027"
},
"frameworkAssemblies": {
"System.Data.Entity": "4.0.0.0"
}
},
"dnxcore50": {
"dependencies": {
"System.Net.Http": "4.0.1-beta-23516"
}
}
},
"exclude": [
"wwwroot",
"node_modules"
],
"publishExclude": [
"**.user",
"**.vspscc"
]
}
2. web.config (wwwroot)
<?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%" forwardWindowsAuthToken="false" startupTimeLimit="3600" />
</system.webServer>
</configuration>
3. global.json
{
"sdk": {
"version": "1.0.0-rc1-update2"
}
}
Finally, last topics that may help to find the error:
- I am not pretty sure if httpPlatformHandler was installed correctly. Where can I find it or make sure it is?
- I have other web projects hosted on IIS Local, with virtual directories and assigned pools. How might this affect port's availability, considering that IIS Express is targeting into port 8000? (App URL: http://localhost:8000/)
If you require additional information for this issue, please let me know.
Thanks in advance!
Karen G.

use User.Identity.Name in ASP.Net Core RC1 app running on IIS7.5

I'm writing an intranet site using ASP.Net Core. I've created the site in VS2015 and selected to use windows authentication. I now need access to the current user account name in my server code. I'm fairly new to this, so I could be wrong, but I believe I should be using User.Identity.Name? When I look at this though, it's null. I'd previously been running the site using self-hosting and had read somewhere that this was to be expected if you were hosting use the generated web.cmd entry point, but would work okay under IIS. I'm now running it under IIS though, but I'm seeing the same behaviour. Can anyone point me at what I'm missing?
This is my web.config file:
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="..\approot\web.cmd" arguments="--server.urls http://address:5001" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600" forwardWindowsAuthToken="true"></httpPlatform>
</system.webServer>
</configuration>
The site is running okay under IIS using this config, apart from the Identity problem. Within ISS I have disabled everything but Windows Authentication for the site using the Authentication settings accessed from the site Features view
In case it's needed, here is a section of my project.json file with dependencies, commands and frameworks:
"dependencies": {
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions" : "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer.Design": "7.0.0-rc1-final",
"System.DirectoryServices.Linq": "1.2.2.1",
"AutoMapper": "4.2.1"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef" : "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {
"dependencies": {
"Services": "1.0.0-*"
}
}
},
There's a bug in the IISPlatformHandler module that requires your to map your app's base URL to a virtual directory (as I understand the solution, anyway!!). Rather annoyingly I'd come across this before posting the question, but it didn't seem to work. I can only assume I'd been trying so many things that I'd mucked up my test the first time round. The site now works perfectly under IIS
Here's the code change to make in your startup class:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
app.Map("/SomeBasePath", (app1) => this.ConfigureInternal(app1, env, loggerFactory));
}
public void ConfigureInternal(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
// your original call to Configure here
}
So you're basically renaming your original Configure method, and calling it from a new Configure method that does the mapping.
Let's say your site was running as http://webserver:1234/Home previously. After this change you would need to access it as http://webserver:1234/SomeBasePath/Home. This was fine for our site, so I'm not sure how you'd do it without the extra node in the URL, if you needed to.

How and what to deploy Angular2 to IIS

Take for instance angular2-quickstart. What files need to be deployed and what settings need to be set to launch this web app from IIS?
This is a Typescript tutorial that I have opted to compile to JavaScript.
Setting up Angular 2 for me was quite an issue because the HTML5 routes (without a hashbang) weren't working.
To get an Angular2 project working on an IIS environment without serving it using the Angular-CLI (you still need it to build it!):
After you're finished with development on your project, you'll need to build (or compile) it to a different environment. If you need to set that up, read this.
The shortest build command you need is:
ng b
In your build folder (if you didn't add an external/different folder, this will be the 'dist' folder in your project), copy the contents to your IIS server.
Ensure the folder of your IIS server has the needed permissions for the IIS_IUSRS group and IUSR user to access it. (Right click on the folder -> Properties -> Security -> Edit -> Add, and type those in. You can click the 'Check Name' button to ensure it's the correct ones you're typing in)
The next issue you need to tackle is getting a web.config file to put in your server folder to fix routing issues.
If we were working with Apache, we would need an .htaccess, but for IIS, we're using a web.config. The one found here worked for me if your application is routing from the root directory of your server.
(Note: As reminded by #Demortes, this will require an additional module to be added to your IIS environment called URLRewrite)
This (web.config) file goes in the root directory of your server.
Hope this helps anyone who had similar issues to me :)
Cheers.
Download and install IIS rewrite plugin https://www.iis.net/downloads/microsoft/url-rewrite
Create application under default website.
Create a folder in c:\inetpub\wwwroot to host the application
After step 8 copy dist folder contents to c:\inetpu\wwwroot\
Before build in index.html change base href="/" to base href="//"
To skip steps 1,2 and 3 for every new build check out step 9 as alternative to step 8
Web config structure.
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" >
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/<appname subfolder>/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Note: Create a Web.config in src folder and add a reference to it in angular-cli.json in assets section so that it gets copied over during each build. -
Otherwise you will have manually create this file every time ng build is used.
not applicable
In angular-cli.json put web.config in assets block
"assets": [
"assets",
"favicon.ico",
"Web.config"
],
In angular-cli.josn put custom css path example so that it will be packaged in styles..bundle.cs
"styles": [
"../node_modules/font-awesome/css/font-awesome.min.css",
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"assets/site.css",
"assets/page.css",
"assets/menu.css",
"styles.css",
"../node_modules/primeng/resources/primeng.min.css",
"../node_modules/primeng/resources/themes/omega/theme.css"
],
If you have custom scripts put those path under scripts section example
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"index.js"
],
ng build --prod
Note: ng build --prod starts AOT (ahead of time compilation) by default in latest version of angular-cli
Note: ng build command deletes dist folder and recreates that folder every time you ng build command
Alternative build command:
ng build --prod --output-path 'C:\inetpub\wwwroot\<appname subfolder>' --base-href /<appname subfolder>'/
a- if you don't want to manually update base-href in index.html
b- if you don't want to copy dist folder and wwwroot folder of app.
Note1: Following command will only work if you open visual code (or any terminal app) with administrative privileges. Otherwise mkdir command to create output folder in wwwroot will fail.
Note2: You still need to update Web.config with . See step 4
Note3: Checkout slash / at both starting and end of --base-href /'/
Check direct quote from one of the posting. Not sure if changing security privileges of IIS_IUSRS group and IUSR user for ...wwwroot\
as described in one of the web links is required. May be it is not required but I am highlighting it over here for you to keep in mind.
Direct quote from another use : " Ensure the folder of your IIS server has the needed permissions for the IIS_IUSRS group and IUSR user to access it. (Right click on the folder -> Properties -> Security -> Edit -> Add, and type those in. You can click the 'Check Name' button to ensure it's the correct ones you're typing in)"
References :
- How and what to deploy Angular2 to IIS
- https://www.youtube.com/watch?v=K0XORWxG11k
The webapp itself needs no server intelligence, as it is just static files - web assets ( *.js, *.html files etc). The static files are what angular2-quickstart generates as output of its build process, which you run in your dev environment (probably locally on your personal computer). The dev environment will need node (+ npm). And infact, you can test this tutorial on your local dev environment without the need for any external server.
edit:
If u look in the package.json u can see it has lite-server:
"scripts": {
"start": "npm run lite",
"lite": "lite-server"
},
Lite server is a small server that simulates a simple (web) file server.
Lightweight development only node server that serves a web app, opens
it in the browser, refreshes when html or javascript change, injects
CSS changes using sockets, and has a fallback page when a route is not
found.
To give you an answer, to serve your app with IIS, you only need http://docs.asp.net/en/latest/fundamentals/static-files.html
I have created a small github project that has Angular2 current as of today (10/13/2016) that runs in IIS 7.5 with routing and under ng serve.
It does use the hash based URL strategy.
It uses angular-cli, the read me has details on how to setup under IIS or ng serve.
https://github.com/howserss/Angular2-IIS-sample-app
Angular 2 routing (with hash) will work without any issue on IIS. Just create default URL rewrite rule which will redirect all the requests to index.html file of your angular app. Rule will redirect all requests to index.html except for required js files and actual angular app urls (i.e. index.html or index.html#/{route-value}.
EX:
<rules>
<rule name="Default">
<match url="(.* ).js|index.html(.*)" negate="true" />
<action type="Rewrite" url="/index.html" />
</rule>
</rules>
Angular 2 routing (without hash) will not work with IIS.
In case of pure HTML application IIS will be routing the incoming request and it will redirect the request to error page if such page does not exist at that location.
In case of .Net MVC application you can create a default route to handle all the incoming request url's and redirect it to your angular index view.
Ex Route for MVC application:
routes.MapRoute(
name: "Angular",
url: "{*url}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
constraints: new { url = new AppFeatureUrlConstraint() }
public class AppFeatureUrlConstraint : IRouteConstraint
{
public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
{
if (values[parameterName] != null)
{
var url = values[parameterName].ToString();
if (url.StartsWith("angular/", StringComparison.InvariantCultureIgnoreCase))
return true;
else
return false;
}
return false;
}
}
Here is a nice and detailed explanation for deploying angular app in IIS. The summarized steps for publishing as a separate website are as follows:-
Create a web site in IIS, lets say the physical path you provided for this web application is C:\Publish.
publish you angular app using the below command:-
ng build --prod
After the application is built successfully copy and paste the contents of dist folder to C:\Publish folder.
Add web.config file to folder C:\Publish with following contents:-
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
All done, now just go to IIS and browse your web-site, you will see it working.
after you build it, copy all files in dist fold put in a fold in your IIS server, it only contains html, css and js files, so just host it like a static website.
It works for any web server, no matter Apache, IIS or nginx.

How can I get Visual Studio Typescript 1.7 intellisense to work with nodejs libraries (angular2, rxjs)?

[SOLVED]
I logged a bug against TypeScript and the fix should be rolled up into the next VS plugin release. Essentially you can get intellisense to work if you specify your module resolution to be "NodeJs". However the compiler doesn't like this because it expects it to be "node". It looks like the fix they're making is to make everything work by specifying "Node".
I'm trying to build an Angular2 project with msbuild because I want to use ASP.Net Web API as my back-end. The code compiles and runs fine, but my editor (SublimeText 3 or Visual Studio 2015) doesn't like the way I import the Angular2 libraries:
boot.ts:
import {bootstrap} from 'angular2/platform/browser'; // error: cannot find module
import {AppComponent} from './app.component';
bootstrap(AppComponent, []);
If I run the same example (Angular2 Hero Tutorial) using the TypeScript compiler directly with a tsconfig.json and node lite-server as documented, then SublimeText3 works and can recognize this syntax just fine. However once I switch to msbuild, I get this intellisense error for some reason. Here's other pieces of my project which I think are relevant:
Folder structure:
\
- index.html
- package.json
\app
- boot.ts
- app.component.ts
\node_modules
\angular2
\platform
- browser.js
- browser.d.ts
package.json:
{
"name": "angular2-webapi",
"version": "1.0.0",
"scripts": {
},
"license": "ISC",
"dependencies": {
"angular2": "2.0.0-beta.0",
"systemjs": "0.19.6",
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.0",
"zone.js": "0.5.10"
},
"devDependencies": {
"typescript": "^1.7.3"
}
}
TypeScript compiler section from csproj file (most of this was copied from the Angular2 Hero tutorial tsconfig file, but some of these were set by VS automatically):
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptJSXEmit>None</TypeScriptJSXEmit>
<TypeScriptCompileOnSaveEnabled>True</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>False</TypeScriptNoImplicitAny>
<TypeScriptModuleKind>System</TypeScriptModuleKind>
<TypeScriptRemoveComments>False</TypeScriptRemoveComments>
<TypeScriptGeneratesDeclarations>False</TypeScriptGeneratesDeclarations>
<TypeScriptNoEmitOnError>True</TypeScriptNoEmitOnError>
<TypeScriptSourceMap>True</TypeScriptSourceMap>
<TypeScriptExperimentalDecorators>true</TypeScriptExperimentalDecorators>
<TypeScriptModuleResolution>node</TypeScriptModuleResolution>
<TypeScriptEmitDecoratorMetadata>true</TypeScriptEmitDecoratorMetadata>
</PropertyGroup>
I've also tried changing the way I reference the Angular2 libraries like below since it matches the actual physical path of the browser script, but unfortunately the generated file doesn't add the ".js" extension to the generated dependency list for some reason. This means that the browser will request the file "browser" instead of "browser.js".
This breaks the runtime:
import {bootstrap} from '../node_modules/angular2/platform/browser';
I'm actually not sure how the system is supposed to know how to resolve the 'angular2/platform/browser' syntax, but it seems to work if I don't use msbuild. And given the fact that this code compiles and runs properly, it seems like it should work in my editor as well. Anyone have any ideas?
As far as project property group is set to
<TypeScriptModuleResolution>NodeJs</TypeScriptModuleResolution>
there is a workaround is to modify Microsoft.Typescript.targets.
It makes compiler to work:
<TypeScriptBuildConfigurations Condition="'$(TypeScriptModuleResolution)' != ''">$(TypeScriptBuildConfigurations) --moduleResolution $(TypeScriptModuleResolution)</TypeScriptBuildConfigurations>
hardcoded as
<TypeScriptBuildConfigurations Condition="'$(TypeScriptModuleResolution)' != '' and '$(TypeScriptModuleResolution)' != 'NodeJs'">$(TypeScriptBuildConfigurations) --moduleResolution $(TypeScriptModuleResolution)</TypeScriptBuildConfigurations>
<TypeScriptBuildConfigurations Condition="'$(TypeScriptModuleResolution)' == 'NodeJs'">$(TypeScriptBuildConfigurations) --moduleResolution node</TypeScriptBuildConfigurations>
PS make sure to take a backup of Microsoft.Typescript.targets
This does appear to be a bug in typescript tooling as #AndrewSorokin describes, but instead of editing Microsoft.Typescript.targets, you can override the incorrect code in your project file. Add the following lines to the end of your project file:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ... -->
<!-- Set the Module Resolution mode to be NodeJs as required by intellisense -->
<!-- See http://stackoverflow.com/questions/34939261/how-can-i-get-visual-studio-typescript-1-7-intellisense-to-work-with-nodejs-libr -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<TypeScriptModuleResolution>NodeJs</TypeScriptModuleResolution>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<TypeScriptModuleResolution>NodeJs</TypeScriptModuleResolution>
</PropertyGroup>
<!-- ... -->
<!-- Override the moduleResolution parameter to tsc to overcome a bug in intellisense -->
<!-- See http://stackoverflow.com/questions/34939261/how-can-i-get-visual-studio-typescript-1-7-intellisense-to-work-with-nodejs-libr -->
<PropertyGroup>
<CompileTypeScriptDependsOn>
SpoofTypeScriptModuleResolution;
$(CompileTypeScriptDependsOn)
</CompileTypeScriptDependsOn>
</PropertyGroup>
<Target Name="SpoofTypeScriptModuleResolution">
<PropertyGroup>
<TypeScriptBuildConfigurations>$(TypeScriptBuildConfigurations.Replace('--moduleResolution NodeJs', '--moduleResolution node'))</TypeScriptBuildConfigurations>
</PropertyGroup>
<Message Text="Options: $(TypeScriptBuildConfigurations)" />
</Target>
</Project>

aspnet5 vNext (rc1) iis 8 - bad gateway 502.3

I realize posts like this exist, I've read/re-read and am still having issues. Most are old or not directly related and so I thought I'd re-post w/a current example.
Trying to get a basic site running in IIS 8.5+ on win server 2012 R2. At this point I'm stuck at "502.3 - Bad Gateway" (error code 80070002, module httpPlatformHandler, notification executeRequestHandler, handler httpplatformhandler)
Relevant info:
dnx 1.0.0-rc1-final clr (x64)
IIS - installed/verified HttpPlatformHandler 1.2 is installed (v1.2.1959)
IIS - setup a "No Managed Code" pool/site
On the server itself I can get the site to show up if i run the "kestrel.cmd" (generated via dnu publish) directly, from the command line and navigate to the site.
Project.json:
{
"version": "1.0.0-*",
"dependencies": {
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final"
},
"commands": {
"kestrel": "Microsoft.AspNet.Server.Kestrel"
},
"frameworks": {
"dnx451": {}
},
"publishExclude": [
"node_modules",
"bower_components",
"**.xproj",
"**.user",
"**.vspscc"
],
"exclude": [
"www",
"node_modules",
"bower_components"
],
"scripts": {
"prepublish": [
"npm install",
"bower install"
]
}
}
Web.config generated after dnu publish:
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="approot\kestrel.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="logs\stdout.log" forwardWindowsAuthToken="false" startupTimeLimit="3600"></httpPlatform>
</system.webServer>
</configuration>
Your help is much appreciated.
I was getting the same issue - iis 8 - bad gateway 502.3.
I went to Turn Windows Features On or Off and enabled IIS.
I cleaned and rebuild the solution and it ran like a charm.
I hope it helps you too.

Resources