异常信息:Unable to create the store directory 无法创建存储区目录的原因

2019/11/21 22:43:11 人评论 次浏览 分类:.NET

无法创建存储区目录

异常信息:Unable to create the store directory. (Exception from HRESULT: 0x80131468)
错误源:mscorlib
堆栈信息: 在 System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope scope, StringHandleOnStack retRootDir)
在 System.IO.IsolatedStorage.IsolatedStorageFile.InitGlobalsMachine(IsolatedStorageScope scope)
在 System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope scope)
在 System.IO.IsolatedStorage.IsolatedStorageFile.GetGlobalFileIOPerm(IsolatedStorageScope scope)
在 System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope scope)
在 System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
在 MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder.GetCurrentStore()
在 MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder..ctor()
在 MS.Internal.IO.Packaging.PackagingUtilities.GetDefaultIsolatedStorageFile()
在 MS.Internal.IO.Packaging.PackagingUtilities.CreateUserScopedIsolatedStorageFileStreamWithRandomName(Int32 retryCount, String& fileName)
在 MS.Internal.IO.Packaging.SparseMemoryStream.EnsureIsolatedStoreStream()
在 MS.Internal.IO.Packaging.SparseMemoryStream.SwitchModeIfNecessary()
在 MS.Internal.IO.Packaging.SparseMemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
在 MS.Internal.IO.Packaging.CompressEmulationStream.Write(Byte[] buffer, Int32 offset, Int32 count)
在 MS.Internal.IO.Packaging.CompressStream.Write(Byte[] buffer, Int32 offset, Int32 count)
在 MS.Internal.IO.Zip.ProgressiveCrcCalculatingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
在 MS.Internal.IO.Zip.ZipIOModeEnforcingStream.Write(Byte[] buffer, Int32 offset, Int32 count)
在 System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
在 System.IO.StreamWriter.Write(String value)


在导出Excel的时候如果Excel文件比较大,就需要在缓冲到临时文件目录。这样子就要求网站应用对临时目录有读写权限。

这个问题主要是目录权限的问题:
要检查下C:\Windows\Temp和C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files 的文件夹是否有网站用户的权限。

如果是用IUSR和IIS_IUSRS发布网站的,一般在这个两个临时目录里面是有权限。如果是自定义网站用户的,要在这个临时目录加上权限。



相关资讯

  • Windows环境下ASP.NET Core项目站点自启动运行

    ASP.NET Core可以通过 IIS站点发布 ,也可以通过自运行启动站点。也就只要安装了dotnet (.net core SDK )就可以自启动网站,不需要依赖IIS。

    2018/11/11 18:00:56
  • VS2017环境与.NET Core SDK下载安装

    都2018年了,如果是VS2015的,还是直接升级到VS2017吧。首先先安装.NET Core SDK,,然后再安装 VS2017。

    2018/7/10 22:57:35
  • VS2015中的.NET Core SDK下载与安装搭建Asp.net core开发环境

    VS2015时没有自带ASP.NET Core(VS2017是自带Core的,只要在安装的时候选择安装core跨平台即可),如果要使用.NET Core的开发环境就需要单独安装.NET Core SDK。下面我们介绍是在VS2015的环境下安装.NET Core SDK的步骤。

    2018/7/10 21:36:05
  • 【window服务系列】C#.Net的window服务的调试

    window service 创建成功之后就可以进行调试了。1.安装并运行服务这里不详细说。可以用installutil.exe或者 netstart。运行之后,服务程序的就是运行在进程中。2.附加到进程。这里不能直接运行启动调试(F5)。选择对应的服务程序进行附加。3.添加调试代码。因为我们要启动了服…

    2017/6/15 20:08:59