none
How to evaluate assembly permissions from Win32 code ? RRS feed

  • Question

  • Hello,
      I am in a Win32 native application, I would like to make some calls to managed code.
    The managed code can be on the network, so I would like to check programmatically if it will be possible to access my assemblies. (The user may have skip the code group installation).
    I would like to do programmatically in Win32 code, what the "Evaluate Assembly" function from the .NET Framework 2.0 configuration does.

    Any advices ?
         Thank you
                            JP
    • Edited by JPI Friday, July 11, 2008 4:44 PM typo
    Friday, July 11, 2008 4:43 PM

Answers

  • That sounds like a fairly pointless exercise, why not just crash so it is obvious to your customer what needs to be done to make your code functional.  Other than that, just catch the exception you'll get.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Thursday, July 17, 2008 7:37 AM
    Saturday, July 12, 2008 1:52 AM
    Moderator

All replies

  • That sounds like a fairly pointless exercise, why not just crash so it is obvious to your customer what needs to be done to make your code functional.  Other than that, just catch the exception you'll get.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Thursday, July 17, 2008 7:37 AM
    Saturday, July 12, 2008 1:52 AM
    Moderator
  • You'd better run the 3rd party managed code under a constrainted application domain. It is quite trouble, but it works!

    Good luck!

    Saturday, July 12, 2008 3:59 PM
  • You are right Hans, I will follow your advice. It is much more easy, I hope I will be able to catch the exception.

    Jeremy, the problem of your prosposal comes from "Domain". To create one I need to run managed code, that can be on the network .... But maybe I misunderstood "constrained application domain" ?

       JP
    Tuesday, July 15, 2008 8:36 AM