Unable to create the store directory. (Exception from HRESULT: 0x80131468)
一个ASP.NET的程序,使用了MS ReportViewer报告控件,在用该控件导出生成Excel文件时,先是提示行不能超过65535。 这个是由于Excel2003的行限制的原因。由于修改成用Excel2007格式导出,用这种方法导出时报了如下错误:
Unable to create the store directory. (Exception from HRESULT: 0x80131468)
错误堆栈: at System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope scope, StringHandleOnStack retRootDir)
at System.IO.IsolatedStorage.IsolatedStorageFile.InitGlobalsNonRoamingUser(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.GetDefaultIsolatedStorageFile()
at MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName)
at MS.Internal.IO.Packaging.SparseMemoryStream.EnsureIsolatedStoreStream()
at MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary()
at MS.Internal.IO.Zip.ZipIOFileItemStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Compression.DeflateStream.InternalWrite(Byte[] array, Int32 offset, Int32 count, Boolean isAsync)
at System.IO.Compression.DeflateStream.Write(Byte[] array, Int32 offset, Int32 count)
at MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.XMLModel.XMLStreamsheetModel.WriteStreamToStream(Stream from, Stream to)
at Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.XMLModel.XMLStreamsheetModel.Cleanup()
at Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.OpenXmlGenerator.FinalizeWorksheet()
at Microsoft.ReportingServices.Rendering.ExcelOpenXmlRenderer.OpenXmlGenerator.SaveSpreadsheet(Stream outputStream, Stream backgroundImage, UInt16 backgroundImageWidth, UInt16 backgroundImageHeight)
at Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection clientCapabilities, Hashtable& renderProperties, CreateAndRegisterStream createAndRegisterStream)
搜索了个原因,说是当导出的文件比较大时(>10M)时,会使用IsolatedStore来保存临时生成的文件,但当前运行ASP.NET的站点用户(Network Service, win2003)没有像Administrator或其它自己新建的账户那样生成本地用户档案,类似于‘C:\Documents and Settings\Default User’这样的文件夹,又没有足够的权限来创建。所以就报了‘Unable to create the store directory’的错误。
解决方法:
1. 使用ASP.NET的用户模拟。在Web.Config中使用类似如下的配置实现模块:
<configuration>
<system.web>
<identity impersonate="true" userName="accountname" password="password" />
</system.web>
</configuration>
关于模拟的信息可考虑:http://support.microsoft.com/kb/306158/zh-cn,http://msdn.microsoft.com/en-us/library/xh507fc5.ASPX
2. 修改注册表: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-20 把 S-1-5-20重命名为其它名称。
该方法只适用于Win2003,如果修改win7的系统,会导致windows激活失效。
参考:
http://www.kevinrohrbaugh.com/blog/tag/openxml
Unable to create the store directory. (Exception from HRESULT: 0x80131468)的更多相关文章
- jenkins网页报错,Unable to create the home directory ‘/usr/share/tomcat7/.jenkins’. This is most likely a permission problem
cd /usr/share/tomcat7 sudo mkdir .jenkins sudo chown tomcat7:nogroup .jenkins 执行以上操作,重启解决
- 线程ava.lang.OutOfMemoryError: unable to create new native thread
近日开发遇到多线程的问题: java.lang.OutOfMemoryError: unable to create new native thread Exception in thread &qu ...
- HTTP Status 500 - Unable to create directory
分析原因: 例如:java web项目 上传图片创建文件夹cd /data/apps/static-web/sjk/driver/attachment/编号/文件名称.jpg 在创建文件目录 /dat ...
- 使用Docker Compose 部署Nexus后提示:Unable to create directory /nexus-data/instance
场景 Ubuntu Server 上使用Docker Compose 部署Nexus(图文教程): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/ ...
- EXCEPTION:FATAL: UNABLE TO CREATE ‘…GIT/INDEX.LOCK’ FILE EXISTS
FATAL: UNABLE TO CREATE ‘…GIT/INDEX.LOCK’ FILE EXISTS Hi, Today I will share you my other experience ...
- 记一次tomcat线程创建异常调优:unable to create new native thread
测试在进行一次性能测试的时候发现并发300个请求时出现了下面的异常: HTTP Status 500 - Handler processing failed; nested exception is ...
- sqlplus链接数据库报ORA-09925: Unable to create audit trail file
[localhost.localdomain]:[/oracle11/app/oracle11/product/11.2.0/dbhome_1/dbs]$ sqlplus / as sysdba SQ ...
- java.lang.OutOfMemoryError: unable to create new native thread如何解决
工作中碰到过这个问题好几次了,觉得有必要总结一下,所以有了这篇文章,这篇文章分为三个部分:认识问题.分析问题.解决问题. 一.认识问题: 首先我们通过下面这个 测试程序 来认识这个问题:运行的环境 ( ...
- Java使用JAX-WS来写webservice时 Unable to create JAXBContext
webservice,作为web开发人员来说必须掌握的一门技术,它的好处这里就不多说了,eclipse中自带了一种生成webservice的 方法,使用JAX-WS,如果我没有弄错的话,它需要java ...
随机推荐
- CentOS7,Firewalld防火墙使用方法
查看防火墙状态 systemctl status firewalld.service 启动firewall systemctl stop firewalld.service 停止firewall sy ...
- Linux chmod command
@ chmod改变一个或多个文件的存取模式 chmod [options] mode files 只有文件属主或特殊用户才能使用该功能来改变文件存取模式.mode可以是数字形式或who opcode ...
- 查看Nodejs 占用的端口
查看 Nodejs 占用的端口 ps -ef | grep node强制关闭端口 kill
- Android使用JNI(从java调用本地函数)
当编写一个混合有本地C代码和Java的应用程序时,需要使用Java本地接口(JNI)作为连接桥梁.JNI作为一个软件层和API,允许使用本地代码调用Java对象的方法,同时也允许在Java方法中调用本 ...
- part 3 Controllers in AngularJS
What happens if the controller name is misspelled? When the controller name is misspelled, 2 things ...
- ruby(html)
有的时候,我们要给汉字标记拼音,让拼音显示要汉字的上面 <ruby>中国人<rp>(</rp><rt>zhong guo ren</rt>& ...
- javascript 操作复选框无效
<script type="text/javascript"> // 操作checkbox复选框按钮 var inputs = $('#article_list').f ...
- 防止服务器被暴力破解使用DenyHosts
公司有台服务器被坏人盯上了,通过日志可以看到一直在做暴力破解ssh. 防止服务器被暴力破解使用DenyHosts 参考链接: 防止ssh破解,Ubuntu安装denyhosts的一些问题 防止你的ss ...
- 【学习笔记】【C语言】指向结构体的指针
1.指向结构体的指针的定义 struct Student *p; 2.利用指针访问结构体的成员 1> (*p).成员名称 2> p->成员名称 3.代码 #include < ...
- webSphere集群部署主要步骤
1.系统管理-节点,添加本机节点和另外一台机器的节点2.建立集群服务cluster,添加成员节点3.将应用部署到集群服务cluster4.将数据库源分别建立到节点作用域5.后续步骤参照安装手册 注意事 ...