Free Support Forum - aspose.com

Mono problem

I created an application with last Aspose Cells build. It works Ok in Windows. But when I try to run in under Mono, I get

Unknown Heap Type : SmartAssembly

I used Aspose.Cells.dll from

"C:\Program Files (x86)\Aspose\Aspose.Cells for .NET\Bin\net2.0\"

as it is recommended in readme.txt

Please help.

Hi,

Thanks for providing us details.

Well, we need to investigate your issue in details whether the issue is with SmartAssembly (as we use SmartAssembly to obfuscate our Aspose.Cells component) or with Aspose.Cells or even with mono.

I have logged a ticket with an id "CELLSNET-41477" for your issue. We will look into it soon.

Once we have any update on it, we will let you know here.

Thank you.

Forgot to say

CentOS 5.7

Mono JIT compiler version 2.8

Hi,

Thanks for using Aspose.Cells.

We have noted your System Environment. Thanks for providing us further information. Once, we will have some update for you, we will let you know asap.

After program prints "Unknown Heap" it contunues to work, but later it crushes at

at Convertor.Program.Main (System.String[] args) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
at �.�.� (System.String , Int32 , FontStyle ) [0x00000] in :0
at �.�.� (�.� , Int32 , RectangleF ) [0x00000] in :0
at �.�.� (System.Drawing.Graphics , Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at �.�.AutoFitColumn (Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at Aspose.Cells.Worksheet.AutoFitColumn (Int32 columnIndex, Int32 firstRow, Int32 lastRow) [0x00000] in :0
at �..CalculateData () [0x00000] in :0
at Aspose.Cells.Pivot.PivotTable.CalculateData () [0x00000] in :0
at Convertor.PivotTableDataProcessor.Process (Aspose.Cells.Worksheet sheet, Convertor.ApplicationAdModel model) [0x00000] in :0
at Convertor.Program.Main (System.String[] args) [0x00000] in :0

Hi,


Please try the attached our latest fix/version: Aspose.Cells for .NET v7.4.1.2.

I have tested into mono (v2.10.9) environment in a simple C# program using the sample code below with the template file attached in the other thread, it works fine.

Also, for the compile time error/issue “Unknown Heap Type : SmartAssembly”, we are already working over it. Once we figure it out, we will let you know here.

Sample code:

string filePath = @“e:\test2\Refresh+Pivot+Table+Example-3.xlsm”;


Workbook sourceworkbook = new Workbook(filePath);


foreach (Aspose.Cells.Worksheet worksheet in sourceworkbook.Worksheets)

{

foreach (Aspose.Cells.Pivot.PivotTable pivotTable in worksheet.PivotTables)

{

pivotTable.RefreshData();

pivotTable.CalculateData();


}//foreach

}//foreach



sourceworkbook.Save(“e:\test2\mono test\out1.xlsx”);

Thank you.

Hi,

Sorry, but Attachment: Present (inaccessible). Can you attach it again ?

Hi,


You may download Aspose.Cells for .NET v7.4.1.2 here

Thank you.

I shall try with your sample file when it will be avaialable, but now I tried my code and my file with Aspose 7.4.1.0 (I didn't find 7.4.1.2, when I downloaded - I got 7.4.1.0). The same. My code now prints the result of CellsHelper.GetVersion

What version of Linux did you used for testing ? I use CentOS 5.7

Aspose Version is : 7.4.1.0
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at �.�.� (System.String , Int32 , FontStyle ) [0x00000] in :0
at �.�.� (�.� , Int32 , RectangleF ) [0x00000] in :0
at �.�.� (System.Drawing.Graphics , Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at �.�.AutoFitColumn (Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at Aspose.Cells.Worksheet.AutoFitColumn (Int32 columnIndex, Int32 firstRow, Int32 lastRow) [0x00000] in :0
at �..CalculateData () [0x00000] in :0
at Aspose.Cells.Pivot.PivotTable.CalculateData () [0x00000] in :0
at Convertor.PivotTableDataProcessor.Process (Aspose.Cells.Worksheet sheet, Convertor.ApplicationAdModel model) [0x00000] in :0
at Convertor.Program.Main (System.String[] args) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
at �.�.� (System.String , Int32 , FontStyle ) [0x00000] in :0
at �.�.� (�.� , Int32 , RectangleF ) [0x00000] in :0
at �.�.� (System.Drawing.Graphics , Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at �.�.AutoFitColumn (Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at Aspose.Cells.Worksheet.AutoFitColumn (Int32 columnIndex, Int32 firstRow, Int32 lastRow) [0x00000] in :0
at �..CalculateData () [0x00000] in :0
at Aspose.Cells.Pivot.PivotTable.CalculateData () [0x00000] in :0
at Convertor.PivotTableDataProcessor.Process (Aspose.Cells.Worksheet sheet, Convertor.ApplicationAdModel model) [0x00000] in :0
at Convertor.Program.Main (System.String[] args) [0x00000] in :0

Hi,


Well, the link I pasted in my previous post will actually make you download v7.4.1.2 (fix).

Anyways, for your information, I tested on Mono 2.10.9 for Windows.

We will setup the Linux environment and check the issue soon. Once we have any update for you, we will let you know here.

Thank you.

Hi,


Could you paste your sample runnable code here and attach your file here, we will check it soon.

Thank you.

Tried 7.4.1.2. It doesn't work correctly even under Windows. Resulting sheets has wrong column widths , wrong rows order (although content is correct). Although, of course, no exception.

Only after I presss Alt-F5 , pivot table looks like it must be.

With 7.2.2.0 in Windows works OK.

Hi

I now found that simple code crashes

Workbook book = new Workbook("template.xlsx");

book.Save("saved.xlsx");

with ANY xlsx file

attached template.xlsx is a simple file for testing

Aspose 7.4.1.2

Linux and Mono information

uname -r
2.6.18-274.el5

cat /etc/*-release
CentOS release 5.7 (Final)

mono -V
Mono JIT compiler version 2.11.4 (tarball Wed Mar 13 12:16:33 OMST 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)


Crush stack trace

Unknown heap type: SmartAssembly

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at �.��.�� (System.String , Single , FontStyle ) [0x00000] in :0
at �.�. (System.String , Aspose.Cells.Font , Double ) [0x00000] in :0
at �.�.�� (System.Drawing.Graphics , Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at �.�.AutoFitRow (Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at Aspose.Cells.Worksheet.AutoFitRow (Int32 rowIndex) [0x00000] in :0
at �.�.�� (Aspose.Cells.Worksheet ) [0x00000] in :0
at ..� (Aspose.Cells.WorksheetCollection ) [0x00000] in :0
at .. () [0x00000] in :0
at ..Write () [0x00000] in :0
at ..� (Aspose.Cells.Workbook , System.IO.Stream , FileFormatType , Aspose.Cells.SaveOptions ) [0x00000] in :0
at Aspose.Cells.Workbook.Save (System.IO.Stream stream, Aspose.Cells.SaveOptions saveOptions) [0x00000] in :0
at Aspose.Cells.Workbook.Save (System.String fileName, Aspose.Cells.SaveOptions saveOptions) [0x00000] in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
at �.��.�� (System.String , Single , FontStyle ) [0x00000] in :0
at �.�. (System.String , Aspose.Cells.Font , Double ) [0x00000] in :0
at �.�.�� (System.Drawing.Graphics , Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at �.�.AutoFitRow (Aspose.Cells.Cells , Int32 , Int32 , Int32 , Int32 , Aspose.Cells.AutoFitterOptions ) [0x00000] in :0
at Aspose.Cells.Worksheet.AutoFitRow (Int32 rowIndex) [0x00000] in :0
at �.�.�� (Aspose.Cells.Worksheet ) [0x00000] in :0
at ..� (Aspose.Cells.WorksheetCollection ) [0x00000] in :0
at .. () [0x00000] in :0
at ..Write () [0x00000] in :0
at ..� (Aspose.Cells.Workbook , System.IO.Stream , FileFormatType , Aspose.Cells.SaveOptions ) [0x00000] in :0
at Aspose.Cells.Workbook.Save (System.IO.Stream stream, Aspose.Cells.SaveOptions saveOptions) [0x00000] in :0
at Aspose.Cells.Workbook.Save (System.String fileName, Aspose.Cells.SaveOptions saveOptions) [0x00000] in :0

Hi,


Thanks for sharing new template file and some more findings.

I have logged it to attach with your existing issue id “CELLSNET-41477”. We will look into it.
Once we have any update on it, we will let you know here.

By the way, I have tested it on mono 2.10.9 for Windows, I only get the “Unknown heap type: SmartAssembly” error while compiling and running the program using your new file. Also, the file is generated fine too. We are setting up your exact environment to evaluate your case properly though.

Thank you.

Hi,

I found the reason of the bug.

CentOS installation which I use had no Windows fonts.

I now made next

Workbook book = new Workbook("template.xlsx");
CellsHelper.FontDir = "/usr/share/fonts/windows/";
book.Save("saved.xlsx");

put into /usr/share/fonts/windows all font files from my Windows installation and now it works OK.

But it is not a reason for crush, I believe.

Thank you.

With best regards

Pavel Dvorkin

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We are pleased to know that your issue is sorted out. If you face any other issue, please feel free to post, we will be glad to help you more.

Your issue relating to Smart Assembly error is already logged. Once, we will have some update for it, we will share it with you asap.

About SmartAssembly. Seems it is only a warning , it doesn't influence on work.

See image.c file in Mono distribution

//////////////////////////

static gboolean
load_metadata_ptrs (MonoImage *image, MonoCLIImageInfo *iinfo)
// ...

} else {
g_message ("Unknown heap type: %s\n", ptr + 8);
ptr += 8 + strlen (ptr + 8) + 1;

//////////////////////////

but after this message function returns TRUE


Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have fixed the issue.

Please download and try this fix: Aspose.Cells for .NET v7.4.2.1 and let us know your feedback.

Hi,


Also, please find attached and try our latest fix/version: Aspose.Cells for .NET v7.4.2.1 (compiled on .NET 2.x and targeted for any CPU with any of the normal .NET framework versions greater than or equal to 2.x (i.e. 2.x, 3.0, 3.5, 4.0, 4.5 etc.)).

I have tested using the attached fix, it works without any SmartAssembly warning issue/exception.

Thank you.

The issues you have found earlier (filed as CELLSNET-41477) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.