0

I have a web hosting which supports ASP.NET Core 2.2. I tried to publish my own asp.net core 2.2 project in it and it worked with just design. And then I added Identity in the project and I added the same database in the host (exported and imported db which created with migrations). I changed the database connection as well, but when I'm trying to publish the same project it gives me this error :

HTTP Error 502.5 - Process Failure

Common causes of this issue:
The application process failed to start
The application process started but then stopped
The application process started but failed to listen on the configured port

Troubleshooting steps:
Check the system event log for error messages
Enable logging the application process' stdout messages
Attach a debugger to the application process and inspect

For more information visit: https://go.microsoft.com/fwlink/?LinkID=808681

Here is my connection string :

"ConnectionStrings": {
    "IdentityConnection": "Data Source=.\MSSQLSERVER2016;Database=ChatIdentity;Integrated Security=False;User ID=halitkal;Password=*;Connect Timeout=15;Encrypt=False;Packet Size=4096"
  },

Here is my webconfig file :

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\ChatSite.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>
<!--ProjectGuid: 028aa0e3-c5ef-4f5c-87ac-e8de39c5ca44-->
jps
  • 20,041
  • 15
  • 75
  • 79
  • But can you run your project in your local ? – Tony Ngo May 25 '19 at 14:08
  • have you checked event logs? – SUNIL DHAPPADHULE May 25 '19 at 14:14
  • Yeah I can run my project in my local server. I forgot that I changed this in my webconfig file: I delete V2 in here to publish it if I don't it throws another error. I couldn't find the event logs too.. – Klyc Creative May 25 '19 at 14:15
  • Kindly check this link https://stackoverflow.com/questions/38624453/asp-net-core-1-0-on-iis-error-502-5 – SUNIL DHAPPADHULE May 25 '19 at 14:19
  • I tried everything except this : For a portable application, dotnet.exe might not be accessible for the user identity of the Application Pool. Confirm that the AppPool user identity has access to the C:\Program Files\dotnet directory. How can i do that with a host i couldn't understand it. and the other things i've tried, nothing worked.. – Klyc Creative May 25 '19 at 14:56
  • I'm using PLESK btw if it helps. – Klyc Creative May 25 '19 at 15:30
  • Did you check the event log? It can give you valuable info regarding the error. – Stam May 25 '19 at 16:19
  • I know I'm being disturbing but it's my first experience and I do not know how to check event log , how to access it actually. – Klyc Creative May 25 '19 at 16:34
  • If you only tested your web app locally upon Visual Studio with IIS Express, add another stage to test it on IIS locally before uploading to any other hosting environment which you have no access to. On local IIS you should be able to reproduce the famous 502.5 and perform relevant troubleshooting all other posts suggested. If later it works on your local IIS but fails on the hosting environment, you know that where the problems are. – Lex Li May 25 '19 at 17:07
  • @KlycCreative Plesk still doesn't support ASP.NET Core, you need to make sure that you change your applciation pool to No Managed Code. You can also refer to blog post https://windowswebhostingreview.com/asp-net-core-hosting-3-simple-steps-to-fix-502-5-error-in-asp-net-core/ – Mark Spencer May 27 '19 at 05:59

1 Answers1

0

Turn on the stdout logs by changing the next line in the web.config

aspNetCore processPath="dotnet" arguments=".\ChatSite.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />

Don't forget create a folder named logs in the same directory that you have your dll files.

Then reboot the application (Application pool if you´re hosting in IIS) then make an http request and then check for generated log, that should give to you the detail about the error.

If that not works, make sure you have the right runtime installed.

Augusto Sanchez
  • 999
  • 1
  • 6
  • 14