The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Security Exception

Last post 06-07-2007, 12:34 AM by aere. 9 replies.
Sort Posts: Previous Next
  •  06-05-2007, 5:49 AM 3035

    Security Exception

     

     Today I upload my webApp on my hosting provider...

    I use LoaderMT in global.asax... Is a EntitySpaces problem or what?

     

    (Sorry for my english Smile

     


    Security Exception

    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.

     

    Stack Trace:

    [SecurityException: That assembly does not allow partially trusted callers.]
    EntitySpaces.Interfaces.esDataProvider.esLoadDataTable(esDataRequest request, esProviderSignature sig) +153
    EntitySpaces.Interfaces.esDynamicQuery.Load() +184
    Category_admin.LoadGrid() +242
    Category_admin.Page_Load(Object sender, EventArgs e) +151
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +47
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953
    System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154
    System.Web.UI.Page.ProcessRequest() +86
    System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
    System.Web.UI.Page.ProcessRequest(HttpContext context) +49
    ASP.admin_category_admin_aspx.ProcessRequest(HttpContext context) in d:\temp\root\07053169\197099b5\App_Web_kgzl5hod.5.cs:0
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
     

  •  06-05-2007, 10:54 AM 3051 in reply to 3035

    Re: Security Exception

    We have tested this and have users that are also using this in Medium Trust environments. This post can show you how to put your local application in Medium Trust mode http://msdn2.microsoft.com/en-us/library/ms998341.aspx

    It's merely a config entrry:

    From:
    <trust level="Full" originUrl="" />

    To:
    <trust level="Medium" originUrl="" />

    Try that locally and see what happens.


    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-05-2007, 11:54 AM 3052 in reply to 3051

    Re: Security Exception

    I think the problem is MySqlClientProvider.dll that "include" the MySql.Data.dll and this is not allowed on my hoster...but tomorrow when I go to office I try to run the application in medium trust by modify the web.config.

     

    But I have MySql.Data.dll in my GAC...the hoster doesn't have there is a problem?

  •  06-05-2007, 12:11 PM 3053 in reply to 3052

    Re: Security Exception

    Ahh, so you're sying the MySql.Data.dll us not "Medium Trust" capable? That could be true ....?  You could always switch to SQLExpress that's free and should work just fine.  You only need to ship the providers you are using, just an FYI ...
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-05-2007, 1:14 PM 3054 in reply to 3053

    Re: Security Exception

    I don't want to change the Db :)

    The project is based on a MySql db.

    I have buy entityspace because "it run in medium trust"...but the MySqlProvider run in medium trust?

    I have read in internet that mysql.data.dll doesn't run in medium trust but there is a way (recompiling the source and bla bla bla) for allow it to run in medim trust.

    Another (very less professional) solution is change the hoster...but Hmm

     Sorry for my english... Stick out tongue
     

  •  06-05-2007, 1:24 PM 3055 in reply to 3054

    Re: Security Exception

    Ok, well, we host on http://www.discountasp.net and I know they do not require medium trust, it's always an option.
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-05-2007, 6:16 PM 3056 in reply to 3055

    Re: Security Exception

    Just to be sure there is no mis-understanding for anyone following along, the EntitySpaces providers do not replace the clients provided by the database vendors. The clients for SQL Server, Access, and Oracle are included with .NET 2.0. The clients for MySQL and VistaDB come from the vendors. We do not ship them.

    Using EntitySpaces LoaderMT, EntitySpaces binaries (including all the EntitySpaces providers) will work under medium trust. We cannot guarantee that a particular client or web host is set up to work under medium trust.

    The MySQL client (Connector/NET or MySql.Data.dll) needs to be recompiled to support medium trust. There are some pre-compiled binaries available on the internet that have the required change in them. But, that may be only half the battle. The MySQL client uses sockets, and some hosts do not allow this by default. In that case, you will have to work with your Host to allow the recompiled MySQL client to work under medium trust.

    If you do not want to change databases, and EntitySpaces makes this relatively painless, as long as you do not have a lot of DB specific stuff in your code, then you'll have to work with your Host and a recompiled MySQL client. If the Host is not responsive, then changing Hosts may be your only choice.


    David Neal Parsons
    www.entityspaces.net
  •  06-06-2007, 5:33 AM 3063 in reply to 3056

    Re: Security Exception

    "The clients for SQL Server, Access, and Oracle are included with .NET 2.0. The clients for MySQL and VistaDB come from the vendors. We do not ship them."

     

    Sure, but your MySqlProvider.dll have a reference to a MySql.Data.dll.

     

    I have found the sources of MySql.Data.dll (5.0.3), I recompile it, but the public token is different respect a original version, and EntitySpace throw an exception like this:

    Could not load file or assembly 'MySql.Data, Version=5.0.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

     

    I can change the hoster...but I think that is not a solution.

  •  06-06-2007, 6:08 AM 3064 in reply to 3063

    Re: Security Exception

    See this POST.
    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  06-07-2007, 12:34 AM 3088 in reply to 3064

    Re: Security Exception

    That post it'r really intreresting!

    But not solve my problem.

    The only solution is change the hoster Sad

     

    Thanks for your support!!!!! 

View as RSS news feed in XML