none
Slidepart.Slide.Save() causes exception "Unable to determine the identity of the domain" RRS feed

  • Question

  • Hello,

    within a Powerpoint AddIn I added a customXml part to a slide and after adding the corresponding customer data tag to the slide I tried to save the slide.

    The error "Unable to determine the identity of the domain" raised. The slide is huge apx. 6.900.000.

    After removing some items from the slide the slide was shrinked to apx 5.000.000 and was save without any problem

    I already read some stuff about the file size concerning this error, what results in the size reduction.

    I read further some things about multitheading that seems to cause the error with big files. But how can I instruct an Open Xml SDK Class method not to use multithreading while saving my slide? My method does not use any multithreading at that point.

    If someone knows how to instruct the save method not to use multithreading or has a completely different solution for my problem, your help is welcome.

    Thanks a lot,

    Karl

     

    Wednesday, October 25, 2017 5:22 PM

Answers

  • Hi Kalle,

    I made a test with your project, and I could reproduce your issue.

    For the root cause of this issue, you could refer below link.

    # Error writing large files using OpenXML

    https://www.lyquidity.com/devblog/?p=65

    For the solution, you could modify the ThisAddIn_Startup code like below:

            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                AppDomainSetup setup = new AppDomainSetup();
                setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory.ToString();
                Evidence evidence = new Evidence();
                evidence.AddHost(new Zone(SecurityZone.MyComputer));
                AppDomain hostedAppDomain = AppDomain.CreateDomain("Demo", evidence, setup);
                var r = System.Reflection.Assembly.GetExecutingAssembly().FullName;
                ObjectHandle handle = hostedAppDomain.CreateInstance(System.Reflection.Assembly.GetExecutingAssembly().FullName, "TestBigSlidesCustomXml.TestForm");
                var form = (TestForm)handle.Unwrap();
                form.Show(); 
            }

    Best Regards,

    Edward

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet. 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, November 9, 2017 10:19 AM

All replies

  • Hi Kalle42,

    Thank you for posting here.

    According to your question is more related to Powerpoint, I will move it to General Office Development forum for suitable support.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions. 

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 26, 2017 8:58 AM
  • Hi Kalle42,

    How did you add the customXML part to the slide? What do you mean apx here?

    Could you share us your project and an example ppt file so we could use them to try to reproduce your issue?

    You could share the files via OneDrive and put links here.

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, October 27, 2017 10:03 AM
  • Hi Terry,

    thank you for your answer. Excuse my late response. I've been out of office for holydays last week.

    I add the CustomXml-String to the SlidePart using the FeedData-Method. A CustomXmlPropertiesPart is added to the CustomXml-Part and a CustomerData Entry is added to the customerDataList of the slidePart.slide.

    I used apx as an abbreviation of approximately. The described problem occurs only with very big slides.

    Saving CustomXml is part of a bigger project but I try to extract it to an example solution, in which the issue occurs as well. If I was successful, where should I upload the project/solution and the example ppt?

    Thank you for your help,

    Karl

    Monday, November 6, 2017 8:35 AM
  • Hi Kalle42,

    You could share the solution and example ppt using OneDrive or other Cloud storage and then put link address here.

    We will start debugging once we receive the example solution. 

    Best Regards,

    Terry


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 6, 2017 9:11 AM
  • Hi Terry,

    it took me a time to extract things into a small example solution.

    First I tried an independent solution but the error doesn't occur. Finally I put the example code into a Powerpoint AddIn solution and the error occurred again.

    I zipped the AddIn solution and added two example presentations into the bin\debug\presentations folder:

    https://www.dropbox.com/s/e9nt7zhev2uzswm/TestAddin%28csh%29-BigSlidesCustomXml.zip?dl=0

    Adding CustomXmls to the big slides presentation causes the exception "Unable to determine the identity of the domain"

    In the smaller slides presentation I reduced the number of shapes in the slides. Adding CustomXmls to these slides  causes no exception.

    Thank you for your help and best regards,

    Karl

    Wednesday, November 8, 2017 12:42 PM
  • Hi Kalle,

    I made a test with your project, and I could reproduce your issue.

    For the root cause of this issue, you could refer below link.

    # Error writing large files using OpenXML

    https://www.lyquidity.com/devblog/?p=65

    For the solution, you could modify the ThisAddIn_Startup code like below:

            private void ThisAddIn_Startup(object sender, System.EventArgs e)
            {
                AppDomainSetup setup = new AppDomainSetup();
                setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory.ToString();
                Evidence evidence = new Evidence();
                evidence.AddHost(new Zone(SecurityZone.MyComputer));
                AppDomain hostedAppDomain = AppDomain.CreateDomain("Demo", evidence, setup);
                var r = System.Reflection.Assembly.GetExecutingAssembly().FullName;
                ObjectHandle handle = hostedAppDomain.CreateInstance(System.Reflection.Assembly.GetExecutingAssembly().FullName, "TestBigSlidesCustomXml.TestForm");
                var form = (TestForm)handle.Unwrap();
                form.Show(); 
            }

    Best Regards,

    Edward

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet. 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thursday, November 9, 2017 10:19 AM
  • Hi Edward,

    Thank you for help. This exactly fixed my problem.

    I had to do some adoptions because in my project the OpenXml methodsare not running in such a compressed solution. In fact the OpenXml SDK method calls are condensed in a static class part of class library.

    At least I changed the static class to a singleton and create the instance by a new AppDomain. I had some remoting problems to pass OpenXml objects like Slidepart outside the class because the OpenXml objects are not serializable.

    Finally I now have a class with mixed up instance methods which writes to the OpenXml-Files using an instance created by an appdomain and static methods which read from the openXml files and provide content and OpenXml objects.

    I'm not sure, if this the way one should develop these things but at this point it works.

    Further hints for a better solution are welcome.

    Thank you and best regards,

    Karl

    Thursday, November 16, 2017 11:12 AM