The SDK comes with a tool called PEVerify.exe. See if you can run this
on your assembly before using reflection to load it into your application.
You might want to use the methods in Process class (from
System.Diagnostics namespace) to run PEVerify.exe.
eg., assume your test assembly is called abcd.dll
so, you'd run...
PEVerify.exe abcd.dll /md > results.txt
now, parse through the results.txt to see if it came up with any errors.
If the code is verifiably safe, you'd come up with something like...
================================================== =========
Microsoft (R) .NET Framework PE Verifier Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
All Classes and Methods in abcd.dll Verified.
================================================== =========
Hope this was of some help.
-Azhagan.
"Manish Soni" <ms***@microsoft.com> wrote in message
news:uX**************@TK2MSFTNGP09.phx.gbl...
I am loading an assembly using reflection.
Then I get all the methods in all types.
I want to check whether a method is "unsafe".
The MethodInfo class does not seem to provide this information.
How can I get the info?
Thanks and Regards
Manish Soni