隔离存储异常:无法确定域的身份 [英] Isolated Storage Exception: Unable to determine the identity of domain
问题描述
我在 SQL Server 2012 SP1 Reporting Services 实例中设置了一个订阅,该实例将一个 34MB 的文件导出到 Excel 2007-2013 XLSX OpenXML 呈现扩展.订阅抛出以下错误:
I setup a subscription in a SQL Server 2012 SP1 Reporting Services instance that exports a 34MB file to the Excel 2007-2013 XLSX OpenXML render extension. The subscription throws the following error:
System.IO.IsolatedStorage.IsolatedStorageException:无法确定域的身份.
我确认可以将报告从 Report Manager 导出到 Excel 2007-2013 XLSX OpenXML 呈现扩展,没有问题.此错误仅在通过订阅执行报告时发生.我对此进行了研究,并在网上找到了以下建议:
I verified it is possible to export the report from Report Manager to the Excel 2007-2013 XLSX OpenXML render extension without a problem. This error only occurs when the report is executed via a subscription. I have researched this and found the following recommendations on the web:
Two separate Microsoft Connect bug reports 764356 and 764556 that have no listed work arounds.
建议交错订阅,以便一次只运行一个.这无济于事,因为在发生错误时只有一个订阅正在运行.
A recommendation to stagger the subscriptions so that only one runs at a time. This does not help since only one subscription is running at the time of the error.
建议使用 Excel 2003 呈现方法并将行分成单独的选项卡以避免 65,536 行限制.我确实验证了这个方法,但从业务利益相关者的角度来看,这不是一个可以接受的解决方案.
A recommendation to use the Excel 2003 render method and break the rows into separate tabs to avoid the 65,536 row limit. I did verify this works, but this was not an acceptable solution from the business stakeholder's perspective.
一条注释指示任何使用 Excel 2007-2013 呈现方法的大小超过 10 MB 的报告从在内存中生成切换为使用独立存储.没有解释为什么这很糟糕,我认为这样做是有充分理由的——也许是为了限制 RAM 消耗.
A comment indicating any report using the Excel 2007-2013 render method that exceeds 10 MB in size switches from being generated in memory to using Isolated Storage. There's no explanation why this is bad and I assume this was done for a good reason -- perhaps to limit RAM consumption.
建议为 ASP.NET 应用程序的独立存储文件夹中的用户提升权限.我找不到 Reporting Services 的独立存储文件夹所在的位置.
A suggestion to elevate permissions for users in the Isolated Storage folder for the ASP.NET application. I could not find where the Isolated Storage folder is located for Reporting Services.
建议使用绕过此问题的额外代码包装 ASP.NET 的独立存储代码.我找不到将此解决方案应用于 Reporting Services 的方法,因为这是 Microsoft 提供的产品.
A suggestion to wrap the ASP.NET's code for Isolated Storage with extra code that by-passes this problem. I couldn't find a way to apply this solution to Reporting Services since this is a shipped product from Microsoft.
建议修改报表管理器和报表服务器 web.config 文件以在 httpRuntime 节点中包含 maxRequestLength="200000".这并没有改变结果.
A suggestion to modify the Report Manager and Report Server web.config files to include maxRequestLength="200000" in the httpRuntime node. This did not change the results.
建议在 RSReportServer.config 中明确增加内存设置.这似乎没有帮助,因为错误与隔离存储有关,但我出于绝望尝试了它.这并没有改变结果.
A suggestion to increase memory settings explicitly in RSReportServer.config. This didn't seem like it would help since the error relates to Isolated Storage, but I tried it out of desparation. This did not change the results.
建议将 DatabaseQueryTimeout 值从 120 更改为更大的值.这并没有改变结果.
A suggestion to change the DatabaseQueryTimeout value from 120 to something larger. This did not change the results.
更改订阅执行超时值的建议.这并没有改变结果.
A suggestion to change the Subscription execution timeout value. This did not change the results.
以下是完整错误日志条目的副本:
Below is a copy of the full error log entry:
reportrendering!WindowsService_5!1628!04/03/2013-09:48:33:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: , Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.IO.IsolatedStorage.IsolatedStorageException: Unable to determine the identity of domain.
at System.IO.IsolatedStorage.IsolatedStorage._GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, Object& oNormalized)
at System.IO.IsolatedStorage.IsolatedStorage.GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, String& typeName, String& instanceName)
at System.IO.IsolatedStorage.IsolatedStorage._InitStore(IsolatedStorageScope scope, Evidence domainEv, Type domainEvidenceType, Evidence assemEv, Type assemblyEvidenceType, Evidence appEv, Type appEvidenceType)
at System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
at System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
at MS.Internal.IO.Packaging.PackagingUtilities.ReliableIsolatedStorageFileFolder..ctor()
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.NextWorksheet()
at Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer.Render(Report report, NameValueCollection reportServerParameters, NameValueCollection deviceInfo, NameValueCollection
推荐答案
您可以在这里找到解决方案:http://rekiwi.blogspot.com/2008/12/unable-to-determine-identity-of-domain.html
You can find a solution here: http://rekiwi.blogspot.com/2008/12/unable-to-determine-identity-of-domain.html
在 COM 组件中,使用适当的证据创建一个新的 AppDomain 并执行其中的代码.
In the COM component, create a new AppDomain with the appropriate evidence and execute the code in that.
这是为我解决问题的代码示例:
Here is a code example that fixed the problem for me:
AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory.ToString();
//Then we need our evidence
System.Security.Policy.Evidence evidence = new System.Security.Policy.Evidence();
evidence.AddHost(new System.Security.Policy.Zone(System.Security.SecurityZone.MyComputer));
//Now we can fire up an AppDomain running with that evidence.
AppDomain domain = AppDomain.CreateDomain("YourDll.YourClass", evidence, setup);
YourDll.YourClass yourclass = (YourDll.YourClass)domain.CreateInstanceAndUnwrap(typeof(YourDll.YourClass).Assembly.FullName, typeof(YourDll.YourClass).FullName);
yourclass.CallYourMethod();
您想要跨 AppDomain 编组的任何类型都必须标记为 [Serializable()],并且必须从 MarshalByRefObject 继承.例如:
Any types you want to marshall across AppDomains have to marked [Serializable()] and must inherit from MarshalByRefObject. For example:
namespace YourDll
{
[Serializable()]
public class YourClass: MarshalByRefObject
{
...
这篇关于隔离存储异常:无法确定域的身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!