I am receiving the following exception trying to browse a medium trust ASP.NET MVC application (using Linq-to-SQL) on Cassini 3.5.0.2:
Could not load file or assembly 'Cassini, Version=3.5.0.2, Culture=neutral, PublicKeyToken=da0fefd60d522a7d'
or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)
with an inner exception:
Execution permission cannot be acquired.
Stack trace:
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset,
PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset,
PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)
The same application works on IIS7 and on internal VS2008 web server. Cassini works without any problems with ASP.NET MVC application which are not using Linq-to-SQL.
Both the ASP.NET MVC application and the Linq-to-SQL repository project have [assembly: System.Security.AllowPartiallyTrustedCallers]
applied in order to work in medium trust.
Has anyone any clue about this problem?
EDIT
The exception is thrown on this line from Server.cs
:
return appManager.CreateObject(appId, hostType, virtualPath, physicalPath, false);