简体   繁体   English

.net dll问题

[英].net dll question

I have a very n00b question about .NET and DLLs. 我对.NET和DLL有一个非常n00b的问题。 I am developing an application using C# and WPF, and I soon realized that WPF doesn't support charting out of the box. 我正在使用C#和WPF开发应用程序,不久我意识到WPF不支持即开即用的图表。 So I did some searches and found WPF toolkit which looks promising, but I have to install a msi file and reference the dll from that project. 因此,我进行了一些搜索,发现WPF工具包看上去很有希望,但是我必须安装一个msi文件并引用该项目中的dll。 Now my question is, if I build in release mode, will I be able to just hand over the "executable" to others? 现在我的问题是,如果我以发布模式构建,是否可以将“可执行文件”移交给其他人? Thanks a lot in advance. 非常感谢。

Not by building in release mode, but if you can set that up in the publish properties. 不是通过在发布模式下构建,而是如果可以在publish属性中进行设置。

  1. Open project properties 打开项目属性
  2. Go to Publish Tab 进入发布标签
  3. Click Application Files 单击应用程序文件
  4. Change the necessary DLLs to Publish Status Include 更改必要的DLL以发布状态Include

No, you will have to deploy the DLL along with the executable. 不,您将必须与可执行文件一起部署DLL。 That DLL could exist in the GAC or in one of the assembly probing locations. 该DLL可能存在于GAC或程序集探测位置之一中。 One exception I should point out is that you can use ILMerge to embed the DLL in the executable. 我应该指出的一个例外是,您可以使用ILMerge将DLL嵌入可执行文件中。

如果您只想将一个exe交给他人,则需要ILmerge之类的实用程序来将外部dll合并到该exe中。

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

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