Print Page | Close Window

FlexCel on Mac

Printed From: TMS Software
Category: .NET Components
Forum Name: .NET Flexcel
Forum Discription:
URL: http://www.tmssoftware.com/site/forum/forum_posts.asp?TID=6154
Printed Date: 14 Nov 2019 at 2:53pm


Topic: FlexCel on Mac
Posted By: JAMES WILSON
Subject: FlexCel on Mac
Date Posted: 28 Jan 2016 at 9:29pm
When running a console project on a Mac in Xamarin Studio and executing:

XlsFile xls = new XlsFile(filename);

I get the error: The type initializer for 'MonoMac.Foundation.NSString' threw an exception. 

Any ideas about how to address this issue?



Replies:
Posted By: Bruno Fierens
Date Posted: 28 Jan 2016 at 10:57pm

Hi,

 

Have you called "MonoMac.AppKit.NSApplication.Init()?

 

From  https://components.xamarin.com/gettingstarted/flexcel - https://components.xamarin.com/gettingstarted/flexcel

 

5.5.1. Notes.

If doing an OSX Console application, you will need to add a reference to System.Data, System.Xml and XamMac or MonoMac to the app. You might also need to copy XamMac.dll or MonoMac.dll you your output folder. And in a console application, you will need to initialize the Cocoa framework by calling MonoMac.AppKit.NSApplication.Init() (As commented in the code). For normal applications, you will probably not need to do anything.

 




Print Page | Close Window