是否有可能编译控制台应用程序到单个.dll文件? [英] Is it possible to compile a console application into a single .dll file?

查看:233
本文介绍了是否有可能编译控制台应用程序到单个.dll文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有工作过对方的输出5控制台应用程序,并分别安装在我的电脑上(C#4.0,我的作者)。管理部门希望分发此套件的应用程序给其他用户,而不是激动不已,询问非技术用户安装/配置5个独立的应用程序。有没有什么办法可以降低编译每个程序转换成一个.dll文件,并通过一个单一的主应用程序中引用它们?

There are 5 console apps working off each other's outputs and are separately installed on my computer (C# 4.0, I am the author) . Management would like to distribute this suite of apps to other users, but aren't thrilled about asking non-tech users to install/configure 5 separate applications. Is there any way I can compile each program down into a .dll and reference them through a single master application?

推荐答案

问:的主要问题似乎是你不想要5个独立的安装步骤?

Q. The main issue seems to be that you don't want 5 separate installation steps?

一个。制作一个安装程序套件:)使用任何MSI建设者(维克斯,Visual Studio安装程序项目时,InstallShield,的和其他许多人的;哎呀,你甚至可以做一个XCOPY部署在大多数情况下)

A. Make an installer for the suite :) Use any MSI builder (WiX, Visual Studio setup projects, InstallShield, and many others; Heck, you could even do an XCOPY deployment in most cases)

问:如何直接调用这些程序中的单个进程

Q. How do I directly invoke these programs from within a single process?

A 选项:

  1. 在加载程序集的应用程序域。
  2. 使用一个单独的AppDomain中的情况下,名(空间)冲突或版本冲突

问:如何可选择隐藏在外部控制台应用程序从视图中的presence


Q. How do I optionally 'hide' the presence of the external console apps from view

一个。看的 ilmerge 以可能结合外部组件,使他们不再可见。如果你不能使用ilmerge(冲突,或如WPF应用程序)<一href="http://blogs.msdn.com/b/microsoft_$p$pss/archive/2010/02/03/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx"相对=nofollow>你可以把它们嵌入的资源,并加载它们的需求按1和2。上述

A. Look at ilmerge to possibly combine the 'external' assemblies so they aren't visible anymore. If you can't use ilmerge (conflicts, or e.g. WPF apps) you might embed them as resources and load them on demand as per 1. and 2. above

更新的https://libz.$c$cplex.com/ 是一个很好看的项目,使这个容易(还没有尝试过我自己)

Update: https://libz.codeplex.com/ is a nice looking project that makes this easy (haven't tried it myself)

这篇关于是否有可能编译控制台应用程序到单个.dll文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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