This project has moved. For the latest updates, please go here.

Save big xml in Word OpenXml, throw IsolatedStorageException exception

May 11, 2014 at 5:37 AM
Add C++ shim, the exception is still throwed.
DO I HAVE TO FOLLOW THE ClickOnce publish method?

System.IO.IsolatedStorage.IsolatedStorageException: 无法确定域的标识。(Unable to determine the identity of domain)
在 System.IO.IsolatedStorage.IsolatedStorage._GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, Object& oNormalized)
在 System.IO.IsolatedStorage.IsolatedStorage.GetAccountingInfo(Evidence evidence, Type evidenceType, IsolatedStorageScope fAssmDomApp, String& typeName, String& instanceName)
在 System.IO.IsolatedStorage.IsolatedStorage._InitStore(IsolatedStorageScope scope, Evidence domainEv, Type domainEvidenceType, Evidence assemEv, Type assemblyEvidenceType, Evidence appEv, Type appEvidenceType)
在 System.IO.IsolatedStorage.IsolatedStorage.InitStore(IsolatedStorageScope scope, Type domainEvidenceType, Type assemblyEvidenceType)
在 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.Xml.XmlUtf8RawTextWriter.FlushBuffer()
在 System.Xml.XmlUtf8RawTextWriter.RawText(Char* pSrcBegin, Char* pSrcEnd)
在 System.Xml.XmlUtf8RawTextWriter.RawText(String s)
在 System.Xml.XmlUtf8RawTextWriter.WriteStartElement(String prefix, String localName, String ns)
在 System.Xml.XmlWellFormedWriter.WriteStartElement(String prefix, String localName, String ns)
在 System.Xml.Linq.ElementWriter.WriteStartElement(XElement e)
在 System.Xml.Linq.ElementWriter.WriteElement(XElement e)
在 System.Xml.Linq.XElement.WriteTo(XmlWriter writer)
在 System.Xml.Linq.XContainer.WriteContentTo(XmlWriter writer)
在 System.Xml.Linq.XDocument.WriteTo(XmlWriter writer)
在 System.Xml.Linq.XDocument.Save(XmlWriter writer)
May 12, 2014 at 11:36 AM
please explain: this is just for big files(you say), in other words, this works fine with small files?
(it looks like you have no valid appdomain, but i need more info about environment to clearify the situation, an example solution is may helpfull. (public.sebastian[at], remove private code if you want)

May 12, 2014 at 12:44 PM
Yes the AppDomain has no evidence.
In the Shim CLRLoader.cpp
    // Create an AppDomain that will run the managed assembly, and get the
    // AppDomain's _AppDomain pointer from its IUnknown pointer.
    IfFailGo( m_pCorRuntimeHost->CreateDomainEx(T2W(szDirectory), 
        pUnkDomainSetup, 0, &pUnkAppDomain) ); //the evidence is null. I DONT KNOWN HOW TO SET
May 12, 2014 at 1:31 PM
As first:

I find a similar topic: ( (IsolatedStorageException) with big files in Office)
I still figure out how its possible to create an AppDomain in an umanaged .NET hosting scenario.
(Just an idea is to create the appdomain at hand while startup in c# or vb)

I try to find a solution. (create an appdomain in c++)

May 13, 2014 at 12:47 AM
Thank you!