编辑 .NET 程序集并重新编译
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13796802/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Edit .NET assembly and recompile
提问by Bac Clunky
I'm in a really bad situation. I lost my source code and my customer needs to change a little bit in the application. Think of edit an assembly for an example: Test.dll then add a code line and finally recompile it
我的处境非常糟糕。我丢失了源代码,我的客户需要对应用程序进行一些更改。以编辑程序集为例:Test.dll 然后添加一行代码,最后重新编译
So my question is: - Is it possible to do that? - If it's possible, what is the good tool to edit an assembly and then recompile it?
所以我的问题是: - 有可能这样做吗?- 如果可能的话,编辑程序集然后重新编译它的好工具是什么?
回答by Jacob Stanley
回答by Waescher
Exporting & recompiling might not be possible for large applications with many assembies, so I'd suggest a different approach:
对于具有许多程序集的大型应用程序,可能无法导出和重新编译,因此我建议采用不同的方法:
The most comfortable way to go might be to use Reflexilin combination with .NET Reflector(not free) or JustDecompile from Telerik(very free). I did this a few times and had the best result with JustDecompile - even if I'd prefer ILSpyover JustDecompile at any other time.
最舒适的方法可能是将Reflexil与.NET Reflector(非免费)或Telerik 的 JustDecompile(非常免费)结合使用。我这样做了几次,并且使用 JustDecompile 获得了最好的结果——即使我在其他任何时候都更喜欢ILSpy 而不是 JustDecompile。
"Now, how"? you might ask:Here's a small tutorial from the guys at Telerik.
“现在怎么办”?您可能会问:这是 Telerik 人员的一个小教程。
(look at the topic "How can I inject C# code in an assembly?")
(查看主题“如何在程序集中注入 C# 代码?”)


