Reputation: 6964
I have developed a fairly simple ASP.NET Core application. It consists of a core project file, created and built in Visual Studio 2017. The target framework is .NETCoreApp 1.1
and Platform target is x64
.
It also contains two class library projects with target frameworks .NETStandard 1.4
and Platform target x64
.
Due to a bug in VS2017's Web Deploy, I am publishing to file system, then copying the contents of PublishOutput
to my IIS application's directory using FTP.
My server is Windows Server 2012 R2 with all relevant service packs and updates. DotNet Core runtimes have been installed.
When I navigate to my site's URL in the browser, I encounter a bland HTML page which indicates the following:
HTTP Error 502.5 - Process Failure
Common causes of this issue: (lists things)
Troubleshooting steps: (lists things)
For more information visit http://go.microsoft.com/fwlink/?linkid=808681
Needless to say, I've followed the instructions to resolve. The link given shows my error under the heading of Platform conflicts with RID.
The Event Viewer has an Error entry with the following:
Application 'MACHINE/WEBROOT/APPHOST/MY SITE' with physical root 'C:\inetpub\wwwroot\mysite\' failed to start process with commandline "dotnet" .\MySite.dll', ErrorCode = '0x80070002 : 0.
By opening an instance of cmd.exe
at my site's folder, I can execute dotnet mysite.dll
and it runs, hosting on http://localhost:5000
. I can navigate to the site in a browser, as expected.
My Program.cs
is as follows:
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();
host.Run();
My Startup.cs
is mostly uninteresting. Excepting some service definitions, my pipeline is:
app.UseCookieAuthentication();
app.UseRedditMiddleware(); // authentication middleware, custom
app.UseMvc();
app.UseStaticFiles();
Upvotes: 6
Views: 2239
Reputation: 31610
Either the system wide %PATH% to the dotnet folder is not set (IIS runs as a different user) or you did not restart your server after installing ASP.Net Core Server bundle. You can find more some troubleshooting steps in my post about running ASP.NET Core applications with IIS.
Upvotes: 6