Letractively / securityswitch

Automatically exported from code.google.com/p/securityswitch
Other
0 stars 0 forks source link

Problem with Medium Trust Shard Hosting - That assembly does not allow partially trusted callers. #35

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Matt,
Great solution and I have used the older version for many years now on a 
dedicated server for another client.

What steps will reproduce the problem?
1. Install Security Swicth as instructed and include the extra 
"requirePermission" attribute
2. I get an error message similar to the following:

Description: The application attempted to perform an operation not allowed by 
the security policy.  To grant this application the required permission please 
contact your system administrator or change the application's trust level in 
the configuration file. 

Exception Details: System.Security.SecurityException: That assembly does not 
allow partially trusted callers.

Source Error: 

An unhandled exception was generated during the execution of the current web 
request. Information regarding the origin and location of the exception can be 
identified using the exception stack trace below.  

Stack Trace: 

[SecurityException: That assembly does not allow partially trusted callers.]
   SecuritySwitch.SecuritySwitchModule..cctor() +0

 --------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET 
Version:2.0.50727.3618 

Im using the lastest version of Secitity Switch and the Hosting provider tells 
me they operate a Medium Trust SSL certificate. Its .NET 2.0.

Please include the securitySwitch configuration section from your
web.config file.

<configSections>
    <section name="securitySwitch" type="SecuritySwitch.Configuration.Settings, SecuritySwitch" requirePermission="false"  />
  </configSections>

The website is www.saivinternational.com and you can see the problem by just 
navigating to that site as normal. 

Any help would be greatly appreciated as Im banging my head againset the wall 
at this stage.

Best Regards
Colin McBride
colinmcbride@eircom.net

Original issue reported on code.google.com by colinbmc...@gmail.com on 19 Mar 2012 at 2:54

GoogleCodeExporter commented 8 years ago
Unfortunately, this is directly due to the fact that the Common.Logging library 
does not currently support partial trust callers. It is strongly named, and 
thus demands Full Trust by default. I checked the Git repository for the 
project, and it appears that the AllowPartiallyTrustedCallers assembly 
attribute has been added to the code-base. However, no new official release has 
been provided since that attribute made its way in. Once a new release becomes 
available, I'll integrate it to this project, and this module should once again 
work under Medium Trust.

I've sent a message to the Common.Logging owner, inquiring about such an 
official release. I'll keep you posted as I learn news.

Original comment by vent...@gmail.com on 22 Mar 2012 at 2:39

GoogleCodeExporter commented 8 years ago
The Common.Logging project owner replied to me today. He confirmed what I saw 
in the latest code; AllowPartiallyTrustedCallers has been added at the assembly 
level. He is thinking the next official Nuget package will be release 
approximately mid-April. I will watching for that update, so I can integrate it 
into this library and get past this Medium Trust issue once again.

Original comment by vent...@gmail.com on 23 Mar 2012 at 12:37

GoogleCodeExporter commented 8 years ago
Well, Common.Logging v2.1 is out now. However, it targets .NET Framework v3.5 
and v4.0. It no longer supports .NET Framework v2.0, which this module targets. 
Therefore, in order to continue targeting .NET 2.0, to support medium trust, 
and to provide a way to log what's going on inside Security Switch, changes had 
to be made.

Common.Logging is no longer a dependency. A simple [Logging logging mechanism] 
is now offered. Medium Trust should be possible once again as well.

Original comment by vent...@gmail.com on 16 Jun 2012 at 6:28