skip to Main Content

I have deployed my newly created web app developed in Asp.net core 2.1 on a windows based shared plesk hosting.

When i tried to browse the site, it give me this error

403 - Forbidden: Access is denied.

You do not have permission to view this directory or page using the credentials that you supplied.

I have searched it on google but all the help is coming for .net framework not for the .net core framework. Existing solution has suggested me to put this code in web config

 <system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

but in .net core 2.1 there is no web.config in the project..

Bottom line issue is still there, don’t know what to do.

3

Answers


  1. First of all ensure that the your shared hosting provider support .NET Core hosting as it requires .NETCore Hosting Bundle installed and .NET CLR Version set to No Managed Code

    Next publish your ASP.NET Core web app which will generate web.config file and then upload the published files on the server.

    Login or Signup to reply.
  2. You may need to look at hosting’s website or get in contact with them to determine whether they support .NET Core, at what runtime version and what needs to be done to have it set up for a website. They may need to do it manually and you may need to downgrade to their version.

    The simplest way to handle this with shared hostings is to publish fresh template that works locally, copy it over to hosting (or use Web Deploy to do this directly from Visual Studio) and if it errors, write a ticket that your .NET Core site isn’t working and it’s up to them to install and set up everything that is necessary.

    If they can’t get it working, then you won’t be able to either. Nothing else you can do, but to change hosting provider.

    Login or Signup to reply.
  3. Literally just stumbled on this question after finding a resolution to the exact same problem.

    My scenario is:

    1. I was trying to move hosting providers – website already live, running from old host’s webspace.
    2. New host was a shared windows-based web hosting provider, running Plesk.
    3. I was therefore trying to publish my .Net Core 2.0 project to my new host.

    …and I kept getting a “403 – Forbidden Access” error.

    Here’s what I found, which I think might have been part of the problem that the OP faced.

    Even though I had published the website to the remote server correctly, the 403 error kept coming until the new host’s technical support pointed me to one of their knowledgebase posts, which exactly described my scenario and the issues I had, along with how to overcome them.

    Essentially, I didn’t have my domain name’s DNS settings configured yet (as it was still in use, pointing to my previous hosting provider’s webspace) and as such, the DNS are getting ‘confused’.

    The short-term workaround was to add a temporary entry to my hosts file on my PC, which directed the traffic for my website to the IP address of the NEW web hosting provider. (Once full go-live, these are deleted).

    Something like this:

    123.123.123.123 mywebsite.com
    

    This allowed me (on my PC) to bypass the DNS settings on my domain name, and to reference the web content on the new web host’s webspace, to continue setting-up and configuring the website, prior to full migration

    Here’s the link to their knowledgebase article, which I’d have never of thought of, until they mentioned it. (And then it made perfect sense!!)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search