Excel无法使用IIS7和Windows Server 2008 R2(64位)访问该文件

mac*_*ers 4 permissions excel iis-7 identity windows-server-2008

我有一个需要访问Excel文件的Web项目(.NET 4),但最终会出现以下错误消息:

Error occurred during file generation.Microsoft Excel cannot access the file 'D:\xx\xx\abc.xls'. 
There are several possible reasons: 
• The file name or path does not exist. (Actually it is there)
• The file is being used by another program. (It can not happen) 
• The workbook you are trying to save has the same name as a currently open workbook.
Run Code Online (Sandbox Code Playgroud)

在IIS7中,我使用DefaultAppPool,其标识为"myservice",位于Administrators组下.

在IIS下的我的网站的身份验证页面中,启用了匿名身份验证并设置为"应用程序池标识"并禁用了ASP.NET模拟.

在搜索解决方案数小时后,我发现了以下内容,但没有一个能够正常工作

  1. 在C:\ Windows\SysWOW64\config\systemprofile\Desktop中创建文件夹.请参考:这个
  2. 在组件服务中授予"myservice"权限.请参考:这个

有一点奇怪,IIS_IUSRS组中没有任何内容.这是正常的吗?我记得至少有两个用户(DefaultAppPool和Classic .NET AppPool).

我认为这是IIS的权限问题,但我无法解决它.

mac*_*ers 11

问题解决了!!!!!!!!!!我的Excel是2010,应该在C:\ Windows\System32\config\systemprofile中创建"桌面"文件夹