Search found 1 match

by Noodleloaf
Mon 23 May 2022 18:27
Forum: Entity Framework support
Topic: security transparent method exception issue
Replies: 1
Views: 8507

security transparent method exception issue

I have a .NET 4.8 project that runs fine on my dev machine but when deployed hits the following exception. Any guidance on what can be causing and how to resolve is appreciated. It is time-sensitive to resolve. Thanks.

Server Error in '/' Application.
Attempt by security transparent method 'Devart.Data.MySql.Entity.t.a()' to access security critical method 'Devart.Data.MySql.MySqlCommand..ctor()' failed.

Assembly 'Devart.Data.MySql.Entity.EF5, Version=8.21.2066.0, Culture=neutral, PublicKeyToken=09af7300eec23701' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MethodAccessException: Attempt by security transparent method 'Devart.Data.MySql.Entity.t.a()' to access security critical method 'Devart.Data.MySql.MySqlCommand..ctor()' failed.

Assembly 'Devart.Data.MySql.Entity.EF5, Version=8.21.2066.0, Culture=neutral, PublicKeyToken=09af7300eec23701' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.

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:


[MethodAccessException: Attempt by security transparent method 'Devart.Data.MySql.Entity.t.a()' to access security critical method 'Devart.Data.MySql.MySqlCommand..ctor()' failed.

Assembly 'Devart.Data.MySql.Entity.EF5, Version=8.21.2066.0, Culture=neutral, PublicKeyToken=09af7300eec23701' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.]
Devart.Data.MySql.Entity.t.a() +30
Devart.Common.Entity.ew.c() +65
Devart.Data.MySql.Entity.MySqlEntityProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree) +76
System.Data.EntityClient.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree) +423

[EntityCommandCompilationException: An error occurred while preparing the command definition. See the inner exception for details.]
System.Data.EntityClient.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree) +2080
System.Data.EntityClient.EntityProviderServices.CreateCommandDefinition(DbProviderFactory storeProviderFactory, DbCommandTree commandTree) +53
System.Data.Objects.Internal.ObjectQueryExecutionPlan.Prepare(ObjectContext context, DbQueryCommandTree tree, Type elementType, MergeOption mergeOption, Span span, ReadOnlyCollection`1 compiledQueryParameters, AliasGenerator aliasGenerator) +980
System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption) +1277
System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +218
System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +41
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +430
System.Linq.Enumerable.ToList(IEnumerable`1 source) +73
ccTracking.complaint.Page_Load(Object sender, EventArgs e) in C:\Users\Costco Member\Desktop\Ryan_Dev\npTracking\ccTracking\complaint.aspx.cs:146
System.Web.UI.Control.OnLoad(EventArgs e) +108
System.Web.UI.Control.LoadRecursive() +90
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1533

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4261.0