HTTP 403 Forbidden: Access is denied ASP.NET Web API

前端 未结 6 566
野趣味
野趣味 2021-01-12 01:54

I\'m getting the following error when running our ASP.NET Web API project on our production server.

403 - Forbidden: Access is denied. You do not hav

6条回答
  •  死守一世寂寞
    2021-01-12 02:41

    I recently faced same issue while configuring my site on iis (https). In my case, tried several solutions like:

    1. Folder security and access rights, I gave IIS_USER access even to test gave everyone access on deployed folder also change IIS permission but no luck.
    2. Enabled "Directory Browsing" but no luck
    3. Enabled "Anonymous Authentication" but no luck
    4. Reinstall https SSL certificate since using https but no luck

    and several hit and try and at last I found!!!!

    It was very tiny problem I choose "Precompile during publishing" while publishing my website/APIs and when i unchecked this option everything become normal and start working fine, not sure actual reason why this happen but to resolve you may try as showing in picture (visual studio 2019) below:

提交回复
热议问题