简体   繁体   English

可以从其他 .exe 编译一个 .exe 吗? 。网

[英]Can compile an .exe from other .exe? .NET

if a .exe is made with c# and .net framework, can compile other solution, creating an .exe with a determinated code ?, it its possible ?, if yes, should the client have visual studio or something ?如果 .exe 是用 c# 和 .net 框架制作的,可以编译其他解决方案,用确定的代码创建一个 .exe 吗?,它可能吗?如果是,客户端是否应该有 Visual Studio 或其他东西? How can i make an .exe with a determinated .dll from another .exe made with .net ?如何从另一个用 .net 制作的 .exe 制作一个带有确定的 .dll 的 .exe?

Everything .NET Compiels into MSIL. .NET 的一切都编译成 MSIL。 It shares some similarities to JavaBytecode in function.它在功能上与 JavaBytecode 有一些相似之处。

Every MSIL language can use any existing MSIL compilation.每种 MSIL 语言都可以使用任何现有的 MSIL 编译。 Indeed large parts of the .NET Framework itself are in MSIL format.事实上,.NET Framework 本身的很大一部分都是 MSIL 格式。 Normally such code is provided as .dll.通常,此类代码以 .dll 的形式提供。 It is a convention established in decades of programming.这是在几十年的编程中建立的约定。

However internally there is little difference between a MSIL .exe and .dll.但是在内部,MSIL .exe 和 .dll 之间几乎没有区别。 The only differences that come to mind is a bit of Native Copiled Code to bootstrap the whole thing.唯一想到的区别是一些本地编译代码来引导整个事情。 And a manifest that says "this class has the main function".还有一个清单,上面写着“这个类具有主要功能”。 There might be some minor differences (like supported COM interop), but those usually do not mater.可能存在一些细微差别(例如支持的 COM 互操作),但这些通常无关紧要。

Note that this behavior is rare.请注意,这种行为很少见。 Only MSIL and JavaBytecode have this property (.executeables are just .dll's with some extra start code/information).只有 MSIL 和 JavaBytecode 具有此属性(.executables 只是带有一些额外启动代码/信息的 .dll)。

As a result you can use any MSIL .exe like you would a MSIL .dll.因此,您可以像使用 MSIL .dll 一样使用任何 MSIL .exe。 Just add it to the Project references, maybe add a using.只需将它添加到项目引用中,也许添加一个 using。 And go on programming.然后继续编程。

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

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