I decompiled an application with .NET Reflector, and would like to make some changes and compile it again... However when I try to compile it I get a bunch of errors like:
Error 14 'RaiseEvent' definition missing for event 'AsyncReturn'.
Error 55 End of statement expected.
Error 58 Type 'WksStatus' is not defined.
Error 88 Character is not valid.
Error 102 Maximum number of errors has been exceeded.
Is there any way to either:
Thanks a lot for any help! and feel free to ask questions.
Decompiling code isn't an exact science. There's some algorithm the decompiler uses to reverse-engineer the MSIL code and turn it into .net language you can understand.
What more, there's a lot of code you write in .net languages, that is preprocessed or compiled into a different pieces of code. These are sometimes referred to as 'syntactic sugar' (examples for this include : 'yield return', 'lock', extension methods, using, etc.)
There are a lot of decompilers out there, and they're not perfect!
You can even trying opening the same dll/executable in two different decompilers, and often you will see different interpretations of the same MSIL.
If the code you're looking at is open source, you should try to get a hold of the real code!
If it's not, then you shouldn't be hacking it, but reporting a bug of some sort!
And if it's none of the above, well... you'll just have to make the small fixes yourself required, and recompile the code, but I assure you, some of the decompilers can cause errors in the code, and won't work exactly like they do before because of the way they work.