If errors are encountered on your .Net Core application hosted on our ASP .NET Core Windows hosting packages after deployment and you have ensured that all files have been correctly uploaded into your wwwroot folder and the correct application pool is in use please follow the below steps to enable debugging for your .Net Core application.
A good option to check before enabling debugging for the site is to ensure that the correct handlers are being used within your web.config file.
Web.Config Requirements.
- Within your Solid Control Panel navigate to Hosting Space Menu.
- Navigate to File Manager.
- Click on your Website.
- Navigate to the wwwroot folder.
- Locate the web.config file.
- Click on the pencil in page icon to edit the file.
- In the Edit File screen :
- Ensure that the line modules= is set to"AspNetCoreModuleV2" (modules="AspNetCoreModuleV2")
- Ensure that the line hostingModel= is set to "InProcess" (hostingModel="InProcess")
- Click on the green Save button.
Reload the website within your browser and the website should now load.
If this has not corrected the issue follow the below steps to enable debugging on the website and generate the error logs you can use to diagnose the issue.
Enabling Debugging.
Before creating the log folder, where new log files will be created when browsing the website, you will need to enable debugging within your web.config file.
- Within your Solid Control Panel navigate to Hosting Space Menu.
- Navigate to File Manager.
- Click on your Website.
- Navigate to the wwwroot folder.
- Locate the web.config file.
- Click on the pencil in page icon to edit the file.
- In the Edit File screen
- Find the line stdoutLogEnabled="false" and change this to stdoutLogEnabled="true"
You will now need to create the "logs" folder and ensure that the correct permissions are set.
- Within your Solid Control Panel navigate to Hosting Space Menu.
- Navigate to File Manager.
- Click on your Website.
- Navigate to the wwwroot folder.
- Click on the "create folder" button
- Create a new folder called logs.
- click on the lock icon to the right of the newly created logs folder to set the required permissions for the folder.
- enable read and write permissions for the domain name and network service options then click on the green "set permissions" button.
If debugging has been correctly enabled and permissions for the logs folder have been correctly set, browsing the website will generate a new file within the created logs folder that you are able to view and use to debug the issues being faced by your .Net Core application.