Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Fri Feb 17, 2023 3:43 am

[Environment]
- Windows 11
- WPF(.NET 6.0)
- Spire.Office 8.1.1

Creating a Workbook using Spire XLS and executing the Workbook.SaveToStream method results in a PlatformNotSupported Exception.

Even if an Exception occurs, it will be saved in the Stream.
And the Exception won't occur after the first time.

using (MemoryStream ms = new MemoryStream())
{
workbook.SaveToStream(ms);
}

Exception Log
[11:15:26.483][Error][][]An AppDomain first exception occurred.
- Error: System.PlatformNotSupportedException : Operation is not supported on this platform.
System.PlatformNotSupportedException: Operation is not supported on this platform.
at spr劓.ᜀ.BeginInvoke(WebProxy A_0, String A_1, String A_2, Int32 A_3, String A_4, AsyncCallback A_5, Object A_6)
at spr劓.ᜂ(String A_0, String A_1, Int32 A_2, String A_3)

KyungHyunRoh
 
Posts: 8
Joined: Tue Jun 28, 2022 6:02 am

Fri Feb 17, 2023 9:45 am

Hello,

Thanks for your inquiry.
I did currently preliminary in my win 10 system, but I didn’t reproduce the scenario, however, I’ll find a win11 computer and test this scenario on it, and I’ll give you feedback asap. Sorry for the inconvenience caused.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Tue Feb 21, 2023 2:26 am

Thank you for your reply.

As a result of additional tests, no exception occurs when the license key is not entered.

Enter the current license key as follows.

Code: Select all
Spire.License.LicenseProvider.SetLicenseKey(key: "MyLicenseKey");

KyungHyunRoh
 
Posts: 8
Joined: Tue Jun 28, 2022 6:02 am

Tue Feb 21, 2023 1:23 pm

Hello,

Thanks for your feedback.
I created a WPF project to test your scenario in win11, but I didn't reproduce your issue, could you please offer your simple test project that can reproduce your issue. Your can put the project to OneDrive, then share us the download link. Thanks for your assistance in advance.

Sincerely,
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Wed Feb 22, 2023 2:00 am

Attached the test project.

You need to set System.AppDomain.CurrentDomain.FirstChanceException event in App.xaml.cs.

I have a question,
What does WebProxy do when SaveToStream or SaveToFile runs?
I have verified that the HttpWebRequest is supposed to transfer specific data.
What the WebProxy does needs a clear answer.
Attachments
WpfApp1.zip
(3.85 KiB) Downloaded 371 times

KyungHyunRoh
 
Posts: 8
Joined: Tue Jun 28, 2022 6:02 am

Wed Feb 22, 2023 2:44 am

Hello,

Thanks for your feedback.
I test the project you provided, and I reproduced your issue, and logged it into our issue tracking system with the ticket number SPIREXLS-4486. Our development team will investigate it. Once there are any updates, I will inform you in time. Sorry for the inconvenience caused.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Fri Mar 03, 2023 1:08 am

PlatformNotSupported Exception occurs not only in Spire.XLS but also in Spire.DOC. However, the occurrence time is different. In the case of DOC, it occurs when a new Document instance is created. I hope this issue is resolved soon.

Code: Select all
Document doc = new Document();

KyungHyunRoh
 
Posts: 8
Joined: Tue Jun 28, 2022 6:02 am

Fri Mar 03, 2023 9:17 am

Hello,

Thanks for your feedback.
I reproduced the issue you mentioned, and I have reported to our Dev team, they will investigate it. Once there are any updates about the issue, I will inform you in time.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Tue Mar 07, 2023 6:49 am

Hello,

Greeting from E-iceblue.
For the issue with the number SPIREXLS-4486, I have some information to inform you according to the feedback from our Dev team.
There are many try{}catch{} code blocks inside our product to catch and handle exceptions. The exception (PlatformNotSupported Exception) caught by the method (FirstChanceException) you used is actually handled internally by our product. For the exceptions not handled internally by our product, there will occur secondary exceptions when caught using your method. Therefore, this is not a bug.

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Wed Mar 08, 2023 5:44 am

Thank you for your reply.

PlatformNotSupported Exception will be handled as an exception.
However, I have not yet received an answer to my last question.

KyungHyunRoh wrote:Attached the test project.

You need to set System.AppDomain.CurrentDomain.FirstChanceException event in App.xaml.cs.

I have a question,
What does WebProxy do when SaveToStream or SaveToFile runs?
I have verified that the HttpWebRequest is supposed to transfer specific data.
What the WebProxy does needs a clear answer.


will wait for the reply.

KyungHyunRoh
 
Posts: 8
Joined: Tue Jun 28, 2022 6:02 am

Wed Mar 08, 2023 6:42 am

Hello,

Thanks for your feedback.
I’m sorry that I didn’t understand your meaning. Do you want to use webProxy to pass data or are you confused about what our product does with webProxy when using saveToFile or saveToStream methods?

Sincerely
Abel
E-iceblue support team
User avatar

Abel.He
 
Posts: 1010
Joined: Tue Mar 08, 2022 2:02 am

Return to Spire.XLS