简体   繁体   English

在Windows Store应用程序中使用dll

[英]Using a dll in a Windows Store Application

I am developing a Windows Store application in c# and I want to use a library to generate excel file within the application. 我正在用C#开发Windows Store应用程序,并且我想使用一个库在应用程序内生成excel文件。 This one seems to be good to me: http://www.libxl.com 这个似乎对我很好: http//www.libxl.com

To use it I have: 要使用它,我有:

  • Added the dll as a file in the project. 将dll作为文件添加到项目中。

  • Setted the build action to "Content" and "copy to output directory" to always. 将构建操作设置为“内容”,并将“复制到输出目录”设置为始终。

But when I try to use the library I keep getting a module not found error. 但是,当我尝试使用该库时,我不断收到未找到模块的错误消息。 What am I doing wrong? 我究竟做错了什么?

You must not add the dll to your project. 您不得将dll添加到您的项目中。 Instead rightclick on the references node in your Solution Explorer and then click Add Reference. 而是在解决方案资源管理器中右键单击引用节点,然后单击添加引用。 This popups a dialog where you can selected multiple assemblies you can add. 这会弹出一个对话框,您可以在其中选择可以添加的多个部件。 You then can click on browse and select your dll. 然后,您可以单击浏览并选择您的dll。 After that you can use it in your project. 之后,您可以在项目中使用它。


If you are generating a simple sheet. 如果要生成简单的工作表。 You could much easily generate a .csv file. 您可以轻松地生成一个.csv文件。 On MSDN there is an example of this. MSDN上,有一个示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM