如何将资源添加到现有的已签名程序集中 [英] How to add resource to existing signed assembly
问题描述
给出: -程序集(例如"SomeLib.dll") -文本文件(例如"myconfig.xml")
Given: - an assembly (e.g. "SomeLib.dll") - a text file (e.g. "myconfig.xml")
我需要将文件myconfig.xml嵌入到现有程序集SomeLib.dll中
I need to embed the file myconfig.xml into the existing assembly SomeLib.dll
请在按下答案"之前考虑:我知道编译期间的资源嵌入(csc.exe ../embedresource:file ...).
Please consider before pressing "Answer": I know about resources embeding during compile (csc.exe .. /embedresource:file ... ).
问题是,我需要在程序集创建后嵌入资源.
The thing is that I need to embed a resource after assembly has created.
有可能吗?
我也了解ILMerge.但是还没有找到有效的方法.
I also know about ILMerge. But havn't found how it could help.
推荐答案
您可以使用 Cecil :为此,请加载程序集,添加资源,然后保存到程序集.
You can use Cecil for this: load an assembly, add a resource, save to an assembly.
这篇关于如何将资源添加到现有的已签名程序集中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!