views:

843

answers:

4

Is it possible to use .NET reflector (or an other tool) to modify & recompile the code quickly (i.e. without dumping the source and then use VS to recompile it)?

A: 

Yes( to the is it possible to do it quick-part). There are tools in the Visual Studio Command ( Not the IDE ) that allows you to re-compile code quickly.

Filip Ekberg
A: 

Reflector cannot do this, but other tools can decompile .net assemblies, for example FileDisassembler.

Gerrie Schenck
+6  A: 

You can probably use the Reflexil add-in for Reflector to do that:

Reflexil is an assembly editor and runs as a plug-in for Reflector. Using Mono.Cecil, Reflexil is able to manipulate IL code and save the modified assemblies to disk. Reflexil also supports 'on the fly' C# and VB.NET code injection.

Joey
+1. I've used Reflexil and it works great. Reflexil is the way to go!
Steven
sorry for my noob question, but how to add this plugin to relector ?I mean red gate's .net reflector ? Thanks
Mahesh Velaga
Yes, Red Gate's .NET Reflector. Run it, then go to Menu->View->Add-Ins->[Add Button]. Browse for the plugin .dll and that's it.
Igor Korkhov
@Igor: Thanks! :)
Mahesh Velaga
A: 

Yes, as Filip says there are command line tools such csc.exe (for compiling C# code) but you would still need to dump the source from reflector to a physical file and then edit it using the editor of your choice (such as Notepad++ or simply notepad (why?)). these tools can become quite intense when used for large projects but allow you to things such as multi-file assemblies (which you cant do through the IDE). if your using C# then the first few chapters CLR via C# is a good start to using the command line tools.

Leom Burke