My Situation:
So, I decompiled a .NET assembly with ILSpy into C# last week; since, then, I've put a ton of labour into massaging the files/project, etc. so that they all work correctly again (there were lots of little bugs [mostly caused by ILSpy's code generation process] and random issues and I've been fixing them as I go). I'm now inches away from my goal, with the finish line in sight!
But, lo, and behold: I just realized all of the XML comments are missing. >.<
I did some scouring and I was able to find the .xml intelli-sense file, with all the Visual Studio generated comments inside.
What I would Like to Accomplish:
I would LIKE to copy these comments from the generated .xml intelli-sense file back into the source files (in an automated fashion of course, as there are about 5000 classes in this Assembly).
My Question:
How should I proceed? Are there any tools that can do help me automate this task?
You could use the Roslyn CTP for C# to make a tool that would reinsert the comments into the source files. (http://msdn.microsoft.com/en-us/vstudio/roslyn.aspx) Roslyn creates a tree like structure of your C# code that you can manipulate programmatically and then write back to a file.
Since code files are generated using a tool (ILSpy), code style and formatting (whitespaces and indentations) will be same for almost every code file. What I would do is
PS: just a reminder, to ease string replacing/inserting, always do inserting from bottom of the file to top of the file. this way, whenever you insert a line, indexes of other lines to be inserted will remain same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With