【问题标题】:System.IO.FileNotFoundException: Could not load assembly office. perhaps doesn't exist in the Mono for Android Profile?System.IO.FileNotFoundException:无法加载装配办公室。也许在 Mono for Android Profile 中不存在?
【发布时间】:2016-04-15 15:16:27
【问题描述】:

我正在努力在移动设备上创建 excel 文件。我正在尝试为此使用 Microsoft.Office.Interop.Excel.dll。但添加引用后,构建失败并出现以下错误:

严重性代码描述项目文件行抑制状态 加载程序集时出现错误异常: System.IO.FileNotFoundException:无法加载程序集“办公室, 版本=15.0.0.0,文化=中性,PublicKeyToken=71e9bce111e9429c'。 也许它在 Mono for Android 配置文件中不存在?文件名: 'office.dll' 在 Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference 参考,ReaderParameters 参数)在 Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 程序集,AssemblyDefinition 程序集,布尔顶级)在 Xamarin.Android.Tasks.ResolveAssemblies.Execute() App1

谁能帮帮我?

【问题讨论】:

标签: c# excel xamarin xamarin.android


【解决方案1】:

您尝试添加到项目的基于 CIL 的程序集包含对无法在 Xamarin.Android(或 Xamarin.iOS)下运行的基于 Windows 的本机 dll 的引用。

从商业项目到开源项目,在 Xamarin 中处理 .xlsx 文件有多种选择。

示例:

用于 .NET 的 TMS Flexcel Studio

100% 托管代码 Excel 文件操作引擎以及 Excel 和 PDF 报告生成,适用于 .NET、Xamarin.iOS、Xamarin.Android、Xamarin.Mac

https://blog.xamarin.com/generate-excel-spreadsheets-in-native-mobile-apps/ http://www.tmssoftware.com/site/flexcelnet.asp https://components.xamarin.com/view/FlexCel/

Open-XML-SDK-Xamarin

https://github.com/wotzisname/open-xml-sdk-xamarin

【讨论】:

  • 您能否提供一个示例或修改您的答案以包含一个示例?我无法获得入口点。
  • 从哪里开始?我尝试搜索电子表格或 DocumentType.Workbook。但我什么也没找到。可以举个例子吗?
猜你喜欢
  • 2018-08-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-09-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多