I am considering porting a third-party library to .NET for Windows Store apps. The library makes excessive use of System.Reflection.Emit.OpCodes via calls to the ILGenerator.Emit method overloads.
In the .NET for Windows Store Apps API, the OpCode structure and OpCodes class are included, but there is no ILGenerator class, and as far as I have been able to find out no replacement either.
I am obviously missing something, but: without the ILGenerator class, what is the purpose of including System.Reflection.Emit.OpCode and OpCodes in the .NET for Windows Store apps API?
Good question. While I cannot say for sure, there are only two reasons I can think of that use OpCode / Opcodes (and I cannot really imagine it's used for something else):
Since it's not the former, I guess they're using the latter. The application for this is static code analysis; I myself use it f.ex. to implement some Mocking behavior and figuring out what the lambda expression was that was passed to it (in this case Expressions couldn't be used). Another applications of code analysis that might be more likely in this scenario is checking if certain classes/methods/constructs are used which are disallowed (I can imagine that they don't want you to use certain functionality).