首页 新闻 赞助 找找看

【求助】很头疼的一个错误异常导致session丢失,使用OpenXML操作office时发生的

-1
悬赏园豆:40 [已关闭问题] 关闭于 2011-11-18 14:11

使用OpenXML动态生成Wrod文件时,报了一个访问被拒绝的错误,而且报了这个错误后会出现Session丢失的情况。。

然后查看系统日记发现: 错误提示如下:

(本地测试不会报错,发布到服务器上的IIS上后就报错。 本地环境:XP +VS 2008 + SQL 2005 + IIS5.1 ;服务器环境: Win 2003  + IIS 6+ Sql 2005)

----------------------------------------------------

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/ROOT

Process ID: 3360

Exception: System.ApplicationException

Message: 拒绝访问。 (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

StackTrace:    at System.IO.IsolatedStorage.IsolatedStorageFile.nGetRootDir(IsolatedStorageScope scope)
   at System.IO.IsolatedStorage.IsolatedStorageFile.InitGlobalsNonRoamingUser(IsolatedStorageScope scope)
   at System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope scope)
   at System.IO.IsolatedStorage.IsolatedStorageFile.GetGlobalFileIOPerm(IsolatedStorageScope scope)
   at System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope scope)
   at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
   at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder.GetCurrentStore()
   at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder.Dispose(Boolean disposing)
   at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder.Finalize()

---------------------

有木有人遇到这个问题??? 走过路过就顺手帮我解决了。。吼吼,被折腾的不行了

liuhh的主页 liuhh | 初学一级 | 园豆:179
提问于:2011-11-08 14:47
< >
分享
所有回答(2)
1

你在程序中有没有打开word,如果有的话应该是不能远程打开word程序的问题。你可以在组件管理里面将work设置为远程调用,这样就应该可以解决你的问题。

小小刀 | 园豆:1991 (小虾三级) | 2011-11-11 23:05

呵呵,谢谢你的答复。。。我使用的是OpenXml去操作Word;不需要去设置DOM组件的,就是因为之前用Office组件操作Word 产生了一堆的问题,而且速度超慢,效率低;从而抛弃Dom组件操作而改用OpenXml的。 这个问题最后找到了,是 .net FrameWork下的 隔离存储的问题,就是c盘用户文件目录下有个IsolateStorage 文件夹,然后给这个文件夹添加everyone权限后,这个错误就解决了

支持(0) 反对(0) liuhh | 园豆:179 (初学一级) | 2011-11-18 14:01
0

问题解决!!!是隔离存储的问题造成的。给 C:\Documents and Settings\Default User\Local Settings\Application Data\IsolatedStorage 文件夹添加everyone权限就解决了 (如果目录下没有这个问题就新建一个 名为 IsolatedStorage  的文件夹,然后给予 everyone权限)......泪奔啊,各种搜索,各种调试, 整整花了3天时间才找出问题

liuhh | 园豆:179 (初学一级) | 2011-11-18 14:07
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册