.NET Reflector Support: Can I edit assemblies I’ve opened in .NET Reflector?

Yes, you can. There are two possible approaches, both of which utilise add-ins to .NET Reflector.

The first, assuming that you’ve lost the source code, is to decompile back to source, edit the source code you need to change, and then recompile. If this is what you want to do, please refer to the information at:

http://www.simple-talk.com/community/blogs/bart/archive/2009/07/30/74199.aspx

Bear in mind that .NET Reflector’s decompilation support isn’t perfect-see http://www.simple-talk.com/community/blogs/bart/archive/2009/07/30/74203.aspx for more information-so you’ll probably have to do some, and possibly quite a lot of, spade work to get the code to recompile successfully.

The second, and possibly better, approach is to use Sebastien Lebreton’s Reflexil add-in, which you can find at:

http://sebastien.lebreton.free.fr/reflexil/

Reflexil supports direct editing of the IL, as well as injection of C# and VB code on the fly.