CLRProfiler 4.5 and IL rewriting samples now available RRS feed

All replies

  • (adding empty reply so it looks like this post has been "answered" :-))
    Monday, November 19, 2012 10:56 PM
  • Hi David,

    Discussion type is more appropriate.

    Best regards,

    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, November 20, 2012 11:37 AM
  • Using the metadata API to add brand new methods into mscorlib.dll

    Does the restriction of not being able to reference methods in modules outside of mscorlib still exist?
    Wednesday, November 21, 2012 2:13 PM
  • Hi, Jeffrey.

    Yes.  To be precise, a method inside mscorlib is not allowed to reference anything outside mscorlib.  (Specifically, it is illegal to add an AssemblyRef to mscorlib that references another module.)  This is why it's useful to add methods directly to mscorlib.  That way any helpers that your rewritten IL needs to call can sit directly in mscorlib.

    It is legal, though, for a method *outside* mscorlib to reference members in another assembly.  That's why the sample also shows how to add probes that call a separate "ProfilerHelper.dll" assembly. 


    Wednesday, November 21, 2012 4:50 PM