Hey…. Hey… What’s up? This is only short tutorial but I hope it is really help for you if you find difficulty to publish your ASP.NET Core. I have found many users have problem in deploying their ASP.NET Core. The issue might you find like 502 error message that I have discussed on previous post.
403 Forbidden Error
The following is the complete error message:
What’s the problem? Why I receive that error message?
Reasons for 403 Error and How to Fix it
There are many factors that can cause 403 error message, the most common are:
- You publish your site to your hosting provider, but is your host set up to look for your start page? By default, hosting provider look for index.html, index.php, index.aspx, etc, they will use it for default page. The question is what is your default page? Maybe your default page is home.aspx, hello.aspx, or something. Do you understand what I mean? So, make sure that you check you have setup your own default page correctly. Basically on control panel like Plesk, you will be able to setup your own default page or you can ask your hosting provider to setup it for you on IIS.
- The other reason is you created ASP.NET website using one of the template in Visual Studio. If so, you might have selected a template that adds security to your page. By default, anonymous viewing isn’t allowed in some templates. This would be a setting in your config file that would need to be changed. So, to fix it, you could either read up on config settings for security or you could start over with a blank template and try publishing that.
- Before you publish to your hosting provider, make sure that it runs locally, try just uploading simple ASP.NET Core file, so you can narrow down where the problem is
- Make sure that your hosting provider support ASP.NET Core, this is really mandatory to run your ASP.NET Core site. If your hosting provider doesn’t support it, you need to find hosting provider that support ASP.NET Core. If you are looking for reliable ASP.NET hosting partner, check out our latest post.
Final Verdict
ASP.NET is really interesting to learn. I have been using ASP.NET for many years, start from ASP.NET 1.1 until this latest ASP.NET Core. I have experienced many issues when publishing my ASP.NET and I have tried many ASP.NET hosting providers. One that I can recommend is ASPHostPortal, this hosting provider specialize in ASP.NET and the customer staff is really friendly and helpful. If you have problems, they won’t let you walk alone and they will try to help you their best.