Flexcel + Mono + Mkbundle

Hello,


We created a mono app that uses flexcel.
In debug this works as excepcted. Excel and pdf
But now we have created an executable app with mkbundle.
Creating an Excel works, but exporting to a pdf throws an error.
Did somebody have encoutered this also?

thanks


2013-06-11 13:54:18,448   |   1   |   ERROR   |   Exception has been thrown by the target of an invocation.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.EntryPointNotFoundException: CreateZStream
  at (wrapper managed-to-native) System.IO.Compression.DeflateStream:CreateZStream (System.IO.Compression.CompressionMode,bool,System.IO.Compression.DeflateStream/UnmanagedReadOrWrite,intptr)
  at System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, CompressionMode mode, Boolean leaveOpen, Boolean gzip) [0x00000] in <filename unknown>:0 
  at System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, CompressionMode mode, Boolean leaveOpen) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.Compression.DeflateStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode,bool)
  at #1b.#xt.#Fbc (System.Byte[] , Int32 , System.IO.Stream ) [0x00000] in <filename unknown>:0 
  at #z.#xj.Write (System.Byte[] ) [0x00000] in <filename unknown>:0 
  at #z.#Kb.Write (#z.#xj , System.String ) [0x00000] in <filename unknown>:0 
  at #z.#Kb.#Wkb (#z.#xj , System.String ) [0x00000] in <filename unknown>:0 
  at FlexCel.Pdf.PdfWriter.SaveState () [0x00000] in <filename unknown>:0 
  at FlexCel.Render.FlexCelPdfExport.ExportSheet (Int32 startPage, Int32 totalPages) [0x00000] in <filename unknown>:0 
  at FlexCel.Render.FlexCelPdfExport.ExportSheet () [0x00000] in <filename unknown>:0 
  at FlexCel.Render.FlexCelPdfExport.Export (System.IO.Stream pdfStream) [0x00000] in <filename unknown>:0 
  at FlexCel.Render.FlexCelPdfExport.Export (System.String fileName) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0 
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0 
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0 
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0 

Are you adding zlib to the bundle? (using "--deps" in mkbundle)


Googling for the exception, this is an error that happens in mono can't find zlib:
http://mono.1490590.n4.nabble.com/Unhandled-Exception-System-EntryPointNotFoundException-CreateZStream-td2136250.html


I have build it with --deps and put zlib1.dll and mono2-0.dll next to the exe file.

Are you deploying on windows or linux/mac?


If it isn't windows, you might need to supply zlib1.so, not dll.

All in all it looks like a problem in mono not finding zlib (which the pdf engine uses to copress the pdf). You could set pdf.Compress = false to test if it works this way, but for a real release, you really want the pdfs to be compressed.


But just to make sure, if you create the following console app:

same error


2013-06-11 15:36:45,790   |   1   |   ERROR   |   CreateZStream
System.EntryPointNotFoundException: CreateZStream
  at (wrapper managed-to-native) System.IO.Compression.DeflateStream:CreateZStream (System.IO.Compression.CompressionMode,bool,System.IO.Compression.DeflateStream/UnmanagedReadOrWrite,intptr)
  at System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, CompressionMode mode, Boolean leaveOpen, Boolean gzip) [0x00000] in <filename unknown>:0 
  at System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, CompressionMode mode) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.Compression.DeflateStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode)
  at deflate.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0 

and windows is the os btw