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

后端 未结 13 948
广开言路
广开言路 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:31

    On Windows 8/Server 2012 there is no support for aspnet_regiis any more. I tried reinstall using windows features: fail. I tried reinstalling IIS: fail. I tried reinstall through WebPI: fail.

    I solved the issue by setting the ACL's on the Windows Temp Directory.

    Here is a powershell that does the job:

    $dir = "C:\Windows\Temp"
    $acl = get-acl -path $dir
    $new = "IIS_IUSRS","Modify","ContainerInherit,ObjectInherit","None","Allow"
    $accessRule = new-object System.Security.AccessControl.FileSystemAccessRule $new
    $acl.SetAccessRule($accessRule)
    $acl | Set-Acl $dir
    

提交回复
热议问题