Description
I have a .Net profiler (using the native profiler interface). I'm able to instrument code and and use IMetaDataEmit interface to create tokens (e.g. TypeRefs and MemberRefs). However when I try to use DeleteToken() to delete an assembly-scoped custom attribute the program hangs. I tried this from various callbacks (module load finished, assembly load finished, JITStarted) - all resulting the same.
I find the custom attribute token by enumerating custom attribute, close the enumerator, and then try the DeleteToken(), and the runtime hangs.
This happens in all runtime versions I've checked. Probably I'm doing something wrong here, but before providing a full reproducer I'd like to know whether there are known limitations to DeleteToken() or maybe there are better approaches to deleting custom attributes at runtime.
Thanks,
Uri.