“CS0016: Could not write to output file” error when starting an app in IIS 7

后端 未结 13 959
广开言路
广开言路 2020-12-08 22:16

I am running Windows 7, and am not usually a developer in this setting, and have recently built a WCF Rest Service in C#, that I\'m now trying to deploy to IIS just on my lo

13条回答
  •  借酒劲吻你
    2020-12-08 22:32

    I started getting this error too recently in a corporate environment after the company implemented various security measures that took away admin rights from the users.

    For developers, the company authorized the creation of accounts that could be used and we had to add these to the PC's admin group and then change the application pool's identity to use the account.

    EXAMPLE (Windows 10)

    Account created for developers: domain\developer

    Someone with admin rights to the PC will have to do the following:

    • Go to Control Panel\User Accounts\Manage User Accounts
    • Click on the Advanced tab, and click on the Advanced user management button
    • In the lusrmgr page, click on the Groups folder in the left column to bring up groups in the center panel
    • Then secondary-click on the Administrators group and select "Add to Group..."
    • In the Administrators Properties panel, click the "Add..." button
    • A "Select Users, Computers, Service Accounts, or Groups" dialog opens. Add the account (domain\developer in this example)
    • Then click on the OK button (this button will be disabled if you don't have admin rights)

    Now configure the App Pool:

    • Open IIS Manager, select Application Pools
    • Click on the application pool you want so it's highlighted, then click "Advanced Settings..." from the Actions panel on the right
    • Under the Process Model section, click on the Identity setting and the ellipses button
    • In the Application Pool Identity dialog, select "Custom account" and then click the Set button
    • Enter the account and the password

    At this point I was able to close everything, restart IIS and then run my app. It could then access the temp folders it couldn't before.

提交回复
热议问题