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.

Tue Aug 16, 2022 2:49 pm

Hey

Is it possible to retrieve the version of the loaded Spire.Office version in runtime?

The key is tied to a certain version (6.10.x for us) but when opening the NuGet packages view a developer might unknowingly update it to the latest available version. We're looking to add a check in the code to see if the right version is loaded.

Kind Regards,
Bert

Ordina_BG
 
Posts: 1
Joined: Tue Aug 16, 2022 2:39 pm

Wed Aug 17, 2022 8:58 am

Hello Bert,

Thanks for your inquiry.

Based on your requirement, I tried the below code and got the version infomation of the dlls. You can give it a try. Hope it helps you.
Code: Select all
         //get version infomation of Spire.Doc.dll
         var spireDocDllVersion = FileVersionInfo.GetVersionInfo(typeof(Document).Assembly.Location);
         //get version infomation of Spire.Pdf.dll
         var spirePdfDllVersion = FileVersionInfo.GetVersionInfo(typeof(PdfDocument).Assembly.Location);
Sincerely,
Andy
E-iceblue support team
User avatar

Andy.Zhou
 
Posts: 483
Joined: Mon Mar 29, 2021 3:03 am

Return to Spire.XLS