Android Monodroid-Excel文件

Android Monodroid-Excel文件,android,excel,mono,Android,Excel,Mono,我想使用Mono for android从android应用程序创建一个小型Excel工作表。 我尝试同时使用EPPlus和ExcelLibrary.NET库,但在构建项目时遇到了问题: C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundExcepti

我想使用Mono for android从android应用程序创建一个小型Excel工作表。 我尝试同时使用EPPlus和ExcelLibrary.NET库,但在构建项目时遇到了问题:

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
对于通过Mono for Android操作Excel文件,是否有任何修复方法


谢谢。

看起来您正试图在Mono for Android项目中引用预构建的.NET 4.0程序集。你不能可靠地做到这一点(如果你运气好的话,有时它会起作用)。MonoTouch和Mono for Android没有System.Drawing程序集,因此不能使用链接到该程序集的库

您需要做的是为ePlus或ExcelLibrary库创建一个新项目,并使用Mono for Android库项目类型。您可能还需要对该项目进行一些修改,使其不使用System.Drawing的部分,而Mono for Android没有(它有一些类似System.Drawing.RectangleF和SizeF的部分,但缺少大部分)

我本来打算使用这个项目为MonoTouch做这件事(它的许可证比EPPlus更令人满意),但我一直忙于其他事情

我有一个npoi分支,我正在清理这里的API:

一旦我完成这项工作并将其合并到上游,我的计划是创建一个新分支,在那里我将致力于将库移植到MonoTouch和Mono4Android使用的.NET子集。我可能会叫它“手机”之类的

同时,快速而彻底的修复方法是创建一个新的Mono for Android库项目,以npoi的相同方式将所有源文件添加到其中,然后尝试构建。它将失败,但错误将为您提供一个很好的起点,让您知道该无情地删除库的哪些部分。继续这样做,直到编译完成


如果您使用我上面链接的任何一个npoi存储库,我已经做了一些工作来制作font.metrics和其他一些资源文件,我想不出如何为MonoTouch/Android正确构建这些文件,因此与使用1.2.5这样的版本相比,要做的工作会少一些。

您好,谢谢你的回复,我不知道有人在用这样的叉子。我会关注它,因为现在我使用了这个链接中的ExcelWriter类:它对我来说就像一个符咒:pThanks!我也会查一查的。。。也许这会帮我省下很多工作:-)@jstedfast:你的npoi分支的当前状态如何?它对xamarin的monotouch/monodroid有用吗?我想我的enum分支被合并到了上游的NPOI中,但我还没有做过这方面的工作,所以它仍然可能使用monotouch和monodroid中不可用的位