我怎么能嵌入组装成无ILMerge一个控制台应用程序? [英] how can I embed an assembly into a console application without ILMerge?

查看:183
本文介绍了我怎么能嵌入组装成无ILMerge一个控制台应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多关于这里这个帖子,我使用的从另一个这段代码在post 并放置一个委托分配在我的Main()方法。其他职位都没有直接回答我的问题。

There are a lot of posts on here about this, I'm using this code from another SO post and placing a delegate assignation in my Main() method. None of the other posts have directly answered my question.

我有我的第三方组件嵌入作为一种资源,但是当我火起来的应用程序:

I've got my third party assembly embedded as a resource but when I fire up the app:


  • 我得到与内FileNotFoundException异常的TypeInitializationException。它试图找到文件系统和失败的组装。

  • 它从来没有得到到Main方法,其中用于AssemblyResolve事件处理程序被分配

我有嵌入在我Resources.resx两条组装裁判,一个是第三方工具(命令行解析器),另一种是该应用的肉驻留在库文件。

I have two assembly refs that are embedded in my Resources.resx, one is a third party tool (command line parser) and the other is a Library file where the meat of the application resides.

也许这是不可能与一个控制台应用程序? 。似乎不太可能,但我看不出办法解决它。

Maybe this isn't possible with a console app? Seems unlikely but I don't see a way around it.

回复:ILMerge等:我想获得这完全是在做代码不涉及任何工具。原因:我不想让源代码,需要其他队员来安装一个工具,他们可能不已经存储库。如果这是不可能的,那么ILMerge看起来像一个最好的选择。

Re: ILMerge etc: I'd like to get this done entirely in code without involving any tools. Reason: I don't want to have source code in the repository that requires other team members to install a tool that they probably don't have already. If that's not possible then ILMerge looks like the next best option.

推荐答案

考虑使用ILMerge合并assemlies成一个,而不是嵌入作为一种资源。这是下载网站 ILMerge

Consider using ILMerge to merge the assemlies into one rather than embedding as a resource. This is download site for ILMerge.

您将合并您的第三方组件到您的控制台应用程序。

You would merge your third party assemblies into your console app.

这篇关于我怎么能嵌入组装成无ILMerge一个控制台应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆