Results 1 to 3 of 3

Thread: SecurityException That assembly does not allow partially trusted callers

  1. #1
    Join Date
    Feb 2012

    Default SecurityException That assembly does not allow partially trusted callers


    I am migrating a .NET 3.5 project to 4.0. As recommended by Microsoft, I added <NetFx40_LegacySecurityPolicy enabled="true" /> to app.config to continue to use the old security policy. A few of the SecurityException went away after the change, however, spring's didn't. Does anyone have any idea how to get around it?



  2. #2
    Join Date
    Jul 2010


    Are you using the SPRNET 3.5 assemblies under .NET 4.0 or the SPRNET assemblies compiled specifically for .NET 4.0 in this case?

  3. #3
    Join Date
    Apr 2012


    I'm having a similar issue. I'm using the .net 4.0 spring assemblies, and the console app I have consistently fails while trying to initialize logging. This is the error I get:

    Unhandled Exception: System.TypeInitializationException: The type initializer for 'Spring.Context.Support.ContextRegistry' threw an exception.
    ---> Common.Logging.ConfigurationException: Failed obtaining configuration for Common.Logging from configuration section 'common/logging'.
    ---> System.Configuration.ConfigurationErrorsException: An error occurred creating the configuration section handler for common/logging:
    That assembly does not allow partiallyrusted callers. (Z:\Tools\SaaSDataPoster\SaaSDataPoster.exe.Config line 6)
    ---> System.Security.SecurityException: That assembly does not allow partially trusted callers.

    This console app runs fine with .net 2.0. I have used CasPol to set my intranet zone to full trust as well. Does anyone have any ideas on how to make spring with the "new" and "simplified" security model in .net 4.0?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts