none
'Unable to determine the identity of domain' error is generated by MainDocumentPart.Document.Save() method RRS feed

  • Question

  • I have created a SharePoint 2010 TimerJob to merge documents in a SharePoint document library and I'm using OpenXML (DocumentFormat.OpenXml.dll) to achive this.

    The 'SharePoint 2010 Timer' service is running under an account that is member of the local Administrators group.

    Once I have merged all documents my code is executing a mainDocumentPart.Document.Save() and the following error is generated:

    'Unable to determine the identity of domain'  (StackTrace included below)

    If I run the application from VS it works fine and no error is generated.

    I checked AppDomain.CurrentDomain object in both scenarios and following are the difference I noticed between them:

    *** From VS:

    - AppDomain.CurrentDomain: {Name:/LM/W3SVC/1385710652/ROOT-1-129248059693391797There are no context policies.}

    - BaseDirectory: C:\inetpub\wwwroot\wss\VirtualDirectories\32836

    - DynamicDirectory: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\8146e898\985647a0

    - ShadowCopyFiles: true

    *** From 'SharePoint 2010 Timer' service:

    - AppDomain.CurrentDomain: {Name:DeafaultDomainThere are no context policies.}

    - BaseDirectory: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN

    - DynamicDirectory: null

    - ShadowCopyFiles: false

    ActivationContext and ApplicationIdentity in both scenarios was null.

    Any help will be appreciated. Thanks.

    ===================

    Unable to determine the identity of domain. 
    StackTrace:  

    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.Packaging.CompressEmulationStream.Write(Byte[] buffer, 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 System.Xml.XmlUtf8RawTextWriter.FlushBuffer()    
    at System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)    
    at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)     at System.Xml.XmlWellFormedWriter.WriteString(String text)    
    at DocumentFormat.OpenXml.OpenXmlLeafTextElement.WriteContentTo(XmlWriter w)    
    at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)    
    at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)    
    at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)    
    at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)    
    at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)    
    at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)    
    at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)    
    at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)    
    at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)    
    at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)    
    at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)    
    at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)    
    at DocumentFormat.OpenXml.OpenXmlElement.WriteTo(XmlWriter xmlWriter)    
    at DocumentFormat.OpenXml.OpenXmlCompositeElement.WriteContentTo(XmlWriter w)    
    at DocumentFormat.OpenXml.OpenXmlPartRootElement.WriteTo(XmlWriter xmlWriter)    
    at DocumentFormat.OpenXml.OpenXmlPartRootElement.SaveToPart(OpenXmlPart openXmlPart)    
    at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.SavePartContents()    
    at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose(Boolean disposing)    
    at DocumentFormat.OpenXml.Packaging.OpenXmlPackage.Dispose()    
    at eNovator.DocumentGenerator.AssembleDocument.AssembleDocuments(String templateDocument, String publishedBy, String currentWebURL)

     

    • Moved by Anjali Ch -MSFT Friday, August 20, 2010 4:21 PM Routing to Open Xml forum (From:SharePoint 2010 - Using Visual Studio with SharePoint and other programming)
    Thursday, August 5, 2010 3:59 PM

All replies


  • I tried to replicate this issue but I could not reproduce the error.

    Your question falls into the paid support category which requires a more in-depth level of support.  Please visit the below link to see the various paid support options that are available to better meet your needs. http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, September 13, 2010 2:58 PM