-
Hi! I want to extract a list of all the strings in the assembly I'm building. Right now I have a function which, in runtime, detects when a string is printed to screen and logged into a DB for translation, but this has obvious flaws. I just wanted to ask if ILSpy has this string extraction feature planned, or it's not even on the map. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I think there is no need to use ILSpy for that, just Mono.Cecil is enough to do the job. Scan through all the IL instructions and look for the ldstr opcode. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I'll try that, it sounds really easy to do. |
Beta Was this translation helpful? Give feedback.
-
Hi @siegfriedpammer , thanks for your message. I went with the Mono.Cecil because it seemed easier (actually it was incredibly easy and fast to do,much more than I expected). After all, this process will be run only once a month (or even less often) over a single assembly. However if I ever need to do something more complex that needs more performance, I'll try your method. Thanks a lot for the answers. |
Beta Was this translation helpful? Give feedback.
I think there is no need to use ILSpy for that, just Mono.Cecil is enough to do the job. Scan through all the IL instructions and look for the ldstr opcode.