locked
Web API configuration in IIS RRS feed

  • Question

  • User360451555 posted

    Am having problems configuring ASP.NET Web API 2 to run under IIS 10.0. I set the application to run under ApplicationPoolIdentity DefaultAppPool. Its accessing a system resource, a folder to read a file from there. But access is denied. 

    I gave ethe IIS AppPool\DefaultAppPool full fights and permissions to read and manipulate anything in that folder. The folder contains a bunch of other DLL files installed from another 3rd party deliverer. 

    My DefaultAppPool is running .NET CLR version v4.0.30319 and having integrated as a managed pipeline.

    Here is a shot from my event log pertaining just this exception;

    Please help me, what on earth am i missing?

    Wednesday, January 23, 2019 6:03 PM

All replies

  • User1120430333 posted

    I gave ethe IIS AppPool\DefaultAppPool full fights and permissions to read and manipulate anything in that folder. The folder contains a bunch of other DLL files installed from another 3rd party deliverer.

    Why is the file in that folder? Why is not the file placed in some other folder for strictly file access?  Have you tried the NetworkService account? There can be a account that has lessor permissions on the folder that supersedes all other user accounts on the folder in Win10 if IIS is being hosted on Win 10.

    Wednesday, January 23, 2019 8:07 PM
  • User-943250815 posted

    You should not use User folder. Instead make a new folder outside C:\Users, and give permissions on that to Application Pool User.
    Just read permission, then read-write only on sub folders needed.

    Users folder has to many default permissions assigned that propagate down to directories.

    If you can not move to another folder, as DA924 suggested instead of Application Poll you can try Network Service, it should work because Network Service have elevated rights.
    or just your User Name as Application Pool User, this way Application Pool will act as owner of User folder.

    Wednesday, January 23, 2019 9:26 PM
  • User-1038772411 posted

     I configured My web api project in iis server with ip address and i followed below steps its work fine for me. i hope it will work for you same.
    -> In Visual Studio 2017.
    -> build Your project.
    -> Right click on project name in visual studio And Click on public Folder.
    -> Under the new profile : Click Folder Option, Choose Folder (eg. C:\inetpub\wwwroot) create new folder. than publish.
    -> After publish open iis server
    -> Right-Click On the sites : Site name , application pool (defalut your sitename), physical path (choose from save directory like : C:\inetpub\wwwroot), assign IP and port, click Ok.
    -> Than Create on mvc project.
    -> Now Setup Webapi project : Right-Click Under Site And Click Add Application Alias name, Select pool(must remember select your mvc application pool name), physical-path(select published Web-Api-2 path), than Ok.
    -> Finally you connect with webapi2 project in your mvc projects.
    -> Hope you understood. and i know its hardcoded thoery its too tought but really its work fine for me.

    Thursday, January 31, 2019 11:03 AM
  • User-474980206 posted

    check that the anonymous user is configured to use the app pool account or anonymous is disabled.

    Thursday, January 31, 2019 4:59 PM