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 Jul 16, 2019 9:14 pm

I keep getting this error. After digging through the inner exceptions, it shows "The located assembly's manifest definition does not match the assembly reference. spire" no existing support pages look like any help. I am using free spire.office version 4.3.1 from nuget and .net framework 4.6. The problem only occurs for .xls and .xlsx files, and causes an external code crash after attempting to process too many files.
code peice in question:
Code: Select all
using System;
using System.IO;
using System.Windows.Forms;
using Spire.Pdf;
using Spire.Xls;
using Spire.Doc;
using System.Threading;
using System.Threading.Tasks;

        private void openXlsFile(string file)
        {
            try
            {
                    Workbook workbook = new Workbook();
                    workbook.LoadFromFile(file);
                    Worksheet sheet = workbook.Worksheets[0];
                    workbook.Dispose();
            }
            catch (Exception ex)
            {
                 Console.WriteLine(ex.Message);
            }
        }

After some testing i have ruled out that it has anything to do with the specific files checked.

PatrickH
 
Posts: 5
Joined: Tue Jul 16, 2019 7:20 pm

Wed Jul 17, 2019 5:55 am

Hello,

Thanks for your inquiry.
I suggest that you clean all old dlls of our products in your project and install the Free Spire.Office from Nuget again. If the issue still troubles you after trying, please share your sample project for our further investigation. You could send it to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Wed Jul 17, 2019 1:48 pm

that didn't seem to work, but the error list in vs does show the warning "Warning Found conflicts between different versions of "Spire.Pdf" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed."
Also, do I even need "Worksheet sheet = workbook.Worksheets[0];"? All i'm looking to do is test a bunch of files and see if they can be opened.

PatrickH
 
Posts: 5
Joined: Tue Jul 16, 2019 7:20 pm

Thu Jul 18, 2019 8:23 am

Hello,

Thanks for your feedback.
The error message you provided indicates that there are conflicting dlls in your project, so I guess some old dlls were not completely cleared in your project. The correct dlls information in Free Spire.Office is:
Spire.Doc.dll 7.2.8.19040
Spire.Pdf.dll 5.2.17.19040
Spire.XLS.dll 9.2.16.19040
Spire.Presentation.dll 4.2.6.19040
Spire.DataExport.dll 4.1.9.19040
Spire.DocViewer.Forms.dll 4.1.10.19040
Spire.License.dll 1.3.7.40
Spire.PdfViewer.Forms.dll 4.2.7.19040
Spire.Common.dll 2.2.16.19040
Spire.Barcode.dll 3.2.0.14040
If the issue still troubles you, please share your test project with us to help us do an accurate investigation. Here I uploaded my test project for your reference (http://www.e-iceblue.com/downloads/demo/MyTest18251.zip).

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Thu Jul 18, 2019 1:21 pm

I also have Spire.DataExport.ResourceMgr.dll 2.1.0.19040, deleting it yielded the same results.

PatrickH
 
Posts: 5
Joined: Tue Jul 16, 2019 7:20 pm

Fri Jul 19, 2019 2:09 am

Hello,

Thanks for your feedback.
Sorry I forgot to list the Spire.DataExport.ResourceMgr.dll 2.1.0.19040, but it doesn't take effect on your issue.
Did you test my application? Does the issue still happen on your side?
Please share your sample application which has the error to help us investigate your issue quickly. Since our forum has the size limitation for attachment, please upload your application via OneDrive or DropBox and attach the download link here or send the link to our email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Mon Jul 22, 2019 2:03 pm

i have found this in the build log when log verbosity is "detailed"

There was a conflict between "Spire.Pdf, Version=5.2.17.19040, Culture=neutral, PublicKeyToken=663f351905198cb3" and "Spire.Pdf, Version=5.6.32.18046, Culture=neutral, PublicKeyToken=663f351905198cb3".
1> "Spire.Pdf, Version=5.2.17.19040, Culture=neutral, PublicKeyToken=663f351905198cb3" was chosen because it was primary and "Spire.Pdf, Version=5.6.32.18046, Culture=neutral, PublicKeyToken=663f351905198cb3" was not.
1> References which depend on "Spire.Pdf, Version=5.2.17.19040, Culture=neutral, PublicKeyToken=663f351905198cb3" [C:\Users\paheitkemper\source\repos\CorruptPdfFinder - Copy\packages\FreeSpire.Office.4.3.1\lib\net40\Spire.Pdf.dll].
1> C:\Users\paheitkemper\source\repos\CorruptPdfFinder - Copy\packages\FreeSpire.Office.4.3.1\lib\net40\Spire.Pdf.dll
1> Project file item includes which caused reference "C:\Users\paheitkemper\source\repos\CorruptPdfFinder - Copy\packages\FreeSpire.Office.4.3.1\lib\net40\Spire.Pdf.dll".
1> Spire.Pdf, Version=5.2.17.19040, Culture=neutral, PublicKeyToken=663f351905198cb3, processorArchitecture=MSIL
1> References which depend on "Spire.Pdf, Version=5.6.32.18046, Culture=neutral, PublicKeyToken=663f351905198cb3" [].

though it appears that supposedly the code chose the right version(i can't find the other version's dll file anyway), it looks like this might be related.
On another note, I was unable to replicate the problem with your test code. I was also unable to really confirm that the code did anything at all.

PatrickH
 
Posts: 5
Joined: Tue Jul 16, 2019 7:20 pm

Mon Jul 22, 2019 8:34 pm

I have found the problem! For some reason, visual studio thought that the spire.pdf standalone package was still installed, or it was and didn't uninstall properly(i had initially used only spire.pdf before branching my program into more file types), causing a confrontation between the two versions(no clue why it was 2 different versions to begin with, but whatever). creating a new project with a separate solution and only installing the whole spire.office package from the get-go fixed it. I hope this thread may be of use to anyone in the future with this problem. Thanks for trying to help!

PatrickH
 
Posts: 5
Joined: Tue Jul 16, 2019 7:20 pm

Wed Jul 24, 2019 1:24 am

Hello,

Thanks for your feedback.
Glad to hear that you solved the problem! And it's very grateful for your suggetions. If you encounter any issue related to our products in the future, just feel free to contact us.

Sincerely,
Rachel
E-iceblue support team
User avatar

rachel.lei
 
Posts: 1571
Joined: Tue Jul 09, 2019 2:22 am

Return to Spire.XLS