locked
HTTP Error 401.0 - Unauthorized You do not have permission to view this directory or page RRS feed

  • Question

  • User1224921983 posted

    I have an MVC project. I have created this project on my work pc. I can build and run it there. But when I copy and paste the project to my personal pc, it doesn't work anymore!

    It gives 401 error. I have tried for other projects and they were running without problem. But this project gives me that error and I couldn't find a solution , I'm almost getting crazy..!

    I have given all permissions to the project root folder. There is no authentication for the porject right now. config is like this;

    <authentication mode="None">
          <forms loginUrl="~/Account/SignIn" timeout="2880" />
    </authentication>
    

    I'm stuck, waiting for your suggestions.

    Sunday, May 21, 2017 3:52 PM

All replies

  • User1771544211 posted

    Hi kubimvc,

    kubimvc

    But when I copy and paste the project to my personal pc, it doesn't work anymore!

    Please check if you have installed the same IIS features in your personal pc as the work pc.

    Then you can try the following steps to solve your issue.

    Open IIS Manager, navigate to your website or application folder where the site is deployed to.

    1. Open Advanced Settings (it's on the right hand Actions pane).
    2. Note down the Application Pool name then close this window
    3. Double click on the Authentication icon to open the authentication settings
    4. Disable Windows Authentication
    5. Right click on Anonymous Authentication and click Edit
    6. Choose the Application pool identity radio button the click OK
    7. Select the Application Pools node from IIS manager tree on left and select the Application Pool name you noted down in step 3
    8. Right click and select Advanced Settings
    9. Expand the Process Model settings and choose ApplicationPoolIdentityfrom the "Built-in account" drop down list then click OK.
    10. Click OK again to save and dismiss the Application Pool advanced settings page
    11. Open an Administrator command line (right click on the CMD icon and select "Run As Administrator". It'll be somewhere on your start menu, probably under Accessories.
    12. Run the following command:
      icacls <path_to_site> /grant "IIS APPPOOL\<app_pool_name>"(CI)(OI)(M)
    13. For example:
      icacls C:\inetpub\wwwroot\mysite\ /grant "IIS APPPOOL\DEFAULTAPPPOOL":(CI)(OI)(M)

    Best Regards,

    Jean

    Monday, May 22, 2017 6:49 AM
  • User1224921983 posted

    It didn't work.

    I dont understand.

    I supposed to run the project by simply running from visual studio but it doesn't...

    Monday, May 22, 2017 10:40 AM
  • User1771544211 posted

    Hi kubimvc,

    I supposed to run the project by simply running from visual studio but it doesn't...

    Do you mean that you copied the project source code and paste it into your personal pc and run the project using Visual Studio?

    I thought you are using the IIS to host your application.

    Please try run the Visual Studio as administrator to see if issue still occurs.

    Best Regards,

    Jean

    Wednesday, May 24, 2017 8:25 AM