i am trying to publish my API on my web hosting service using PLESK and i DO the following thing below :
- Publish The Solution on visual Studio
- Zip The Publish folder
- Upload on my host
- check the connection string and web config file
- check the database to ensure be created
- enter the url of host and /swagger(i use that for my api) and nothing works
not even the single line of error
2
Answers
finally i solve the problem by test it on local with the same dll exported to webhost and enable logs for it . it shows the error
First of all, after deployment open your web.config on the host and set stdoutLogEnabled="true".
Create a "logs" folder nearby and grant permissions to write to this folder from IIS worker account (Either "IIS AppPoolYourApplicationPoolName" or IUSR depending on your server config). Alternatively you can set stdoutLogFile to somewhere else.
After this restart the web site and you will get a log files with any startup error that is happening here. Most often cases are lack of appsettings.Production.json with all necessary configs or lack of database access, etc.