简体   繁体   English

将模块链接到小尺寸Assemby

[英]Linking Modules into Small Footprint Assemby

According to http://blogs.msdn.com/b/junfeng/archive/2005/02/12/371683.aspx I should be able to create a single .exe file build from some source code and a .netmodule file. 根据http://blogs.msdn.com/b/junfeng/archive/2005/02/12/371683.aspx,我应该能够从某些源代码和一个.netmodule文件创建一个.exe文件。 However, after looking at http://msdn.microsoft.com/en-us/library/92b5ab4h.aspx and http://msdn.microsoft.com/en-us/library/k669k83h.aspx I cannot seem to make this happen. 但是,在查看http://msdn.microsoft.com/en-us/library/92b5ab4h.aspxhttp://msdn.microsoft.com/en-us/library/k669k83h.aspx之后,我似乎无法做到这一点发生。 Whenever I run my .exe it is looking for the .netmodule externally. 每当我运行.exe时,它都会从外部寻找.netmodule。

Does anyone know of any example showing which options I have to pass to csc to make this do what I want? 有谁知道任何显示我必须传递给csc的选项才能使其执行我想要的操作的示例吗?

For example I have, common.netmodule and program.cs, and I want a single file program.exe that has common.netmodule in the assembly. 例如,我有common.netmodule和program.cs,我想要一个在程序集中具有common.netmodule的文件program.exe。

After rethinking things, I decided to solve the problem at the source code level. 经过重新考虑之后,我决定在源代码级别解决该问题。 Instead of compiling a common.netmodule file, I just have Maven copy my common.cs file into the project specific directories, and then compile. 不用编译common.netmodule文件,而是让Maven将我的common.cs文件复制到项目特定的目录中,然后进行编译。 It works, it's simple, and I cannot believe I wasted so much time trying to figure out the abstruse details of .Net assemblies. 它很有效,很简单,我不敢相信我花了太多时间试图弄清楚.Net程序集的详尽细节。

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

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