Site is running locally. But when it is published in a new server its not.

Julia Kurakula 41 Reputation points
2022-11-08T19:36:57.103+00:00

I am using .net framework 4.5 in VS19. Site is running locally. But when it is published in a new server, the WCF shows 401-"No permission to view the directories" error. I have checked windows authentication in IIS, checked application pool user name, web.config username and edited permissions for all the folders by giving full access to the users. But still I am not able to view the application in the new server.

what am I missing here? Let me know if you need additional information to solve this.

Internet Information Services
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,371 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,119 questions
Windows Server Migration
Windows Server Migration
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Migration: The process of making existing applications and data work on a different computer or operating system.
408 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sam Wu-MSFT 7,036 Reputation points Microsoft Vendor
    2022-11-09T02:15:29+00:00

    @Julia Kurakula

    I have checked windows authentication in IIS

    When you enable windows authentication, please make sure you have disabled anonymous authentication.

    the WCF shows 401-"No permission to view the directories" error
    edited permissions for all the folders by giving full access to the users

    Usually this error is because iis does not have permission to access directories, but you have tried giving the user full access to all folders, please double-check that you have given IIS_IUSRS full access to the site folder.

    If it still doesn't work, please enable failed request tracing and post the error log here, it will provide the key error and warning.

    This link provide the method to enable failed request tracing to capture the detailed error: troubleshooting-failed-requests-using-tracing-in-iis.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Amit Singh 4,846 Reputation points
    2022-11-09T11:10:11.787+00:00

    You need to give NETWORK SERVICE and IIS_USRS access to the folder from which the app is running.

    NETWORK SERVICE is easy to find and do; however, the IIS_USRS, for me at least, doesn't come up if you type IIS. So I did an advanced Search. I selected the Location to be my computer, and the IIS_USRS will appear at the bottom. Give read access and see if that works. Then give more access until it works.

    0 comments No comments

  3. Julia Kurakula 41 Reputation points
    2022-11-10T03:47:49.36+00:00

    Issue is solved. I allowed few users and denied others in the application pool of IIS and it worked.

    0 comments No comments