I ran into this same problem when I deployed my application. There were several problems on my end :)
I went through this page very carefully: ASP.NET Core: Publishing to IIS
First, I didn't have all parts of the .NET Core Windows Server Hosting bundle installed. I ended up doing a fremework-dependent deployment instead of a self-contained deployment. We have a lot of apps and don't want/need each on their own versions of .net core. There would be way too many versions of .net on the box.
Also, note that if your admins performed any updates/upgrades to the server, they could have jacked up your ASP.NET Core installation (see ASP.NET Core: Publishing to IIS troubleshooting section)
Then, I had to fix my web.config... here is my working published web.config:
I didn't publish as an *.exe, I did *.dll (notice my arguments value). Also, my processPath is set to "dotnet".
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\DT.Web.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>
Also, ensure that your project.json options are all set compatible with your server environment (see ASP.NET Core: Publishing to IIS troubleshooting section)
Here is a copy of the of my project.json if it can be of any help:
{
"version": "2.0.1.0",
"dependencies": {
"DT.Common": "2.*",
"DT.Configuration": "2.*",
"DT.Services": "2.*",
"DT.Web.ViewModels": "2.*",
"Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
"Microsoft.AspNetCore.Authentication": "1.1.0",
"Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
"Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.1.0",
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.AspNetCore.Routing": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.1.0-preview4-final",
"type": "build"
},
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel.Https": "1.1.0",
"Microsoft.AspNetCore.Session": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.Extensions.Caching.SqlServer": "1.0.0",
"Microsoft.Extensions.Configuration.Abstractions": "1.1.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0",
"Microsoft.Extensions.Logging.Console": "1.1.0",
"Microsoft.Extensions.Logging.Debug": "1.1.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.Graph": "1.1.1",
"Microsoft.IdentityModel.Clients.ActiveDirectory": "3.13.6"
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.AspNetCore.Razor.Tools": {
"version": "1.1.0-preview4-final",
"imports": "portable-net45+win8+dotnet5.6"
},
"Microsoft.Extensions.Caching.SqlConfig.Tools": "1.1.0-preview4-final"
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
],
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
}
}
}
},
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"publishOptions": {
"include": [
"wwwroot",
"views/**/*.cshtml",
"appsettings.json",
"appsettings.*.json",
"web.config"
]
},
"scripts": {
"prepublish": [ "bower install", "gulp buildprod" ],
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
<AspNetCoreModuleName>AspNetCoreModule</AspNetCoreModuleName>
toAspNetCoreModuleV2
then it will readprocessPath="%LAUNCHER_PATH%"
– Pierre