Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Mar 27, 2024 1:56 pm

Hello Support,
my solution has been updated with Spire.Officefor.NETStandard Version 9.3.1 but i received this exception during spire.Document class instantiation.
---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Permissions, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.

File name: 'System.Security.Permissions, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at Spire.Doc.Document.埫()
at Spire.Doc.Document.䬞()
at Spire.Doc.Document..ctor()


This is the code:
Code: Select all
      
using Document document = new();
document.LoadFromStream(content.TemporaryContent, FileFormat.Auto);


my program run under alpine linux container and it has build with official mcr.microsoft.com/dotnet/aspnet:8.0-alpine image , hosted in kuberntes cluster.

fabrizio.lazzarotto
 
Posts: 20
Joined: Mon Feb 28, 2022 4:16 pm

Thu Mar 28, 2024 6:46 am

Hello,

Thanks for your inquiry.
Our Spire will depend on the following libraries, please check if these dependencies are all installed in your project. If not, please install and try again, or you can remove all the DLL files related to Spire in your project and then reinstall Spire.Officefor.NETStandard Version 9.3.1 directly through the Nuget package manager. If your issue still exists, please share your dockerfile with us and we will further investigate.
    SkiaSharp (>= 1.68.0)
    System.Buffers (>= 4.5.0)
    System.Memory (>= 4.5.0)
    System.Runtime.CompilerServices.Unsafe (>= 4.5.0)
    System.Security.Cryptography.Xml (>= 4.5.0)
    System.Text.Encoding.CodePages (>= 4.5.0)

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 758
Joined: Mon Dec 27, 2021 2:23 am

Thu Mar 28, 2024 7:53 am

Hello William,
i found a workaround, indeed adding <PackageReference Include="System.Security.Permissions" Version="8.0.0" /> it works properly.
Screenshot%202024-03-28%20094927.png

Project references are good and really i don't understand why it's happen.


William.Zhang wrote:Hello,

Thanks for your inquiry.
Our Spire will depend on the following libraries, please check if these dependencies are all installed in your project. If not, please install and try again, or you can remove all the DLL files related to Spire in your project and then reinstall Spire.Officefor.NETStandard Version 9.3.1 directly through the Nuget package manager. If your issue still exists, please share your dockerfile with us and we will further investigate.
    SkiaSharp (>= 1.68.0)
    System.Buffers (>= 4.5.0)
    System.Memory (>= 4.5.0)
    System.Runtime.CompilerServices.Unsafe (>= 4.5.0)
    System.Security.Cryptography.Xml (>= 4.5.0)
    System.Text.Encoding.CodePages (>= 4.5.0)

Sincerely,
William
E-iceblue support team

fabrizio.lazzarotto
 
Posts: 20
Joined: Mon Feb 28, 2022 4:16 pm

Thu Mar 28, 2024 8:07 am

Hello,

Thanks for your feedback.
I am glad to hear that you have found a solution. I did not encounter the issue you mentioned during the initial testing on my end. I speculate that it may be related to your environment, as the lower version of the dependencies may not work properly in your environment. Anyway, please adopt the current way to avoid your problem. If you have any other questions, please feel free to write to us at any time.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 758
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.Doc

cron