That assembly does not allow partially trusted callers. RRS feed

  • Question

  • Only one user of my app gets this message. The app is developed with .Net 3.5 and the user has that on his machine. He can use other machines and launch the app. All users have XP. The only difference in his machine that I can find is that he has .NET 4.0 and .NET 4 Extended as well as .Net 3.5

    What would cause one user out of many to get this error when trying to launch the app?


    Jon Jacobs
    This message was composed entirely from recycled electrons.
    Monday, August 1, 2011 9:23 PM


  • Hi

    The reason for the exception is that your class library doesn’t run with fulltrust permission set. For example, it’s from an intranet share or a website. For more details, you can read SecurityException: That assembly does not allow partially trusted callers.

    To work around this issue, either grant your assembly as fulltrust or add APTCA(AllowPartiallyTrustedCallersAttribute) to the source of the enterprise library you called,  which is an attribute that tells the CLR to remove the implicit LinkDemands. (By default, strongly named, fully trusted assemblies are given an implicit LinkDemand for FullTrust on every public and protected method of every publicly visible class.), for more details, please visit Allowing Partially Trusted Callers.

    For more questions about enterprise library, you can post them here.


    Cookie Luo[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Martin_Xie Friday, August 19, 2011 12:19 PM
    Wednesday, August 3, 2011 2:02 AM

All replies