4

我有一个需要访问 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.

在 IIS7 中,我使用 DefaultAppPool 和管理员组下的身份“myservice”。

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

在搜索了几个小时的解决方案后,我发现了以下内容,但它们都不起作用

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

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

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

4

1 回答 1

11

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

于 2012-06-21T07:05:17.713 回答