I'm having a similar problem with the System.Security.SecurityException. It happens within my generated code at this line:
FlatlandMedia.NinjaRoutes.Dal.DaoClasses.RegionDAO..ctor() in RegionDAO.cs
I'm a novice at using ildasm, but I took a look at the two strong-named assemblies that I'm referencing. SD.LLBLGen.Pro.ORMSupportClasses.NET20.dll has this in its manifest:
.custom instance void [mscorlib]System.Security.AllowPartiallyTrustedCallersAttribute::.ctor() = ( 01 00 00 00 )
However, SD.LLBLGen.Pro.DQE.SqlServer.NET20.dll does not have this reference in its manifest. Am I missing something? BTW, here's my ISP's policy:
The custom setting is basically medium level with some exceptions including ODBC, OLEDB, Reflection Permissions and Web Permissions. This setting cannot be overridden.
Here are the permissions granted by the medium trust level:
Medium
Permissions are limited to what the application can access within the directory structure of the application.
No file access is permitted outside of the application's virtual directory hierarchy.
Can access SQL Server
Can send email by using SMTP servers
Limited rights to certain common environment variables
No reflection permissions whatsoever
No sockets permission
To access Web resources, you must explicitly add endpoint 'URLs' - either in the originUrl attribute of the element or inside the policy file.
The following exceptions have been granted in addition to the ones listed above:
ODBC
OLEDB
Reflection Permissions
Web Permission
Thanks for the help,
Pete