out of interest how is corflags inappropriate? I managed to read your entire question without reading that part and did this lovely screenshot of corflags before re-reading...

On 8/02/2012 6:21 PM, Ian Thomas wrote:

Another "environment" type question for those with more experience than I.

I assume that (apart from Corflags CLI tool, which is inappropriate) the correct .NET method to detect what an assembly was compiled for (AnyCPU, x86, x64) is Module.GetPEKind <http://msdn.microsoft.com/en-us/library/system.reflection.module.getpekind%28v=vs.90%29.aspx> ?

How do I safely load and report on its status, some DLL (not knowing if it is a .NET assembly)? That is, can someone give me a really simple example? And secondly, although I know what I compiled my own app for -- at the time I'm doing it -- I can see a situation when the application should self-test what is was compiled for -- ie, load itself in a different process? How would I do that?

I can't find examples of either of these today.

(about 2-3 years ago, I did some of this precautionary testing, but I've entirely forgotten how. I'm not intending to head the wrong way into extensibility -- I would use MEF if I had to load and use DLLs for some extensibility.)

------------------------------------------------------------------------

Ian Thomas
Victoria Park, Western Australia

Reply via email to