Raz Razman
Raz Razman

Reputation: 411

How to recompile IL

So I need to make a very simple change to a DLL file.

I have successfully exported the dll file to IL language with Reflector, and have found the change I need to make (its just changing a URL). So if I make the change in notepad and save it, well thats great & easy, but now I cannot figure out how to build it back into a DLL file. I have tried to export it to a C# project which works, but building it gives me so many errors.

VS doesn't want to open it since exporting to IL doesn't provide a project file.

Upvotes: 3

Views: 2793

Answers (3)

Raz Razman
Raz Razman

Reputation: 411

Figured it out, works perfectly: decompile: ildasm file.dll /out:file.il edit using notepad recompile: ilasm file.il /DLL /fold /nologo /noautoinherit

.. and of course you can use your favourite decompiler tool such as VS or dotpeek to view the code nicely, then find it in the dirty IL version to edit it.

Upvotes: 2

CodingWithSpike
CodingWithSpike

Reputation: 43698

Just like VisualStudio ships with ildasm, it also ships with ilasm. So you should be able to do:

ilasm /dll myapp.il

Upvotes: 2

user5447154
user5447154

Reputation:

I used Telerik JustDecompile. from a DLL I can create my project (right click on the assembly / create project c#/vb or IL), I open with VS, I change and I recompile.

Test it !

Upvotes: 0

Related Questions