重写成员时违反了继承安全规则:'System.Data.Entity.Utilities.TaskExtensions

用户名

以前,我的网站正常运行,但是后来我将GoDaddy ASP.NET设置从vb更改为c#。我不记得要更改任何其他内容。现在我收到此错误:

Server Error in '/' Application.

Inheritance security rules violated while overriding member: 'System.Data.Entity.Utilities.TaskExtensions+CultureAwaiter`1<T>.UnsafeOnCompleted(System.Action)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

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.TypeLoadException: Inheritance security rules violated while overriding member: 'System.Data.Entity.Utilities.TaskExtensions+CultureAwaiter`1<T>.UnsafeOnCompleted(System.Action)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

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: 


[TypeLoadException: Inheritance security rules violated while overriding member: 'System.Data.Entity.Utilities.TaskExtensions+CultureAwaiter`1<T>.UnsafeOnCompleted(System.Action)'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.]
   System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) +0
   System.Reflection.RuntimeAssembly.GetExportedTypes() +21
   Heroic.AutoMapper.HeroicAutoMapperConfigurator.<LoadMapsFromAssemblies>b__4(Assembly a) +10
   System.Linq.<SelectManyIterator>d__16`2.MoveNext() +188
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +191
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +77
   Heroic.AutoMapper.HeroicAutoMapperConfigurator.LoadMapsFromAssemblies(Assembly[] assemblies) +110
   Heroic.AutoMapper.HeroicAutoMapperConfigurator.LoadMapsFromCallerAndReferencedAssemblies(Func`2 assemblyFilter) +225
   HeroicCRM.Web.AutoMapperConfig.Configure() in AutoMapperConfig.cs:14

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
   WebActivatorEx.BaseActivationMethodAttribute.InvokeMethod() +73
   WebActivatorEx.ActivationManager.RunActivationMethods(Boolean designerMode) +350
   WebActivatorEx.ActivationManager.Run() +78

[InvalidOperationException: The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
   System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +613
   System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +141
   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +102
   System.Web.Compilation.BuildManager.ExecutePreAppStart() +157
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946024
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

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

这是发生错误的代码,第14行是“ HeroicAutoMapperConfigurator”:

[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(HeroicCRM.Web.AutoMapperConfig), "Configure")]
namespace HeroicCRM.Web
{
    public static class AutoMapperConfig
    {
        public static void Configure()
        {
            //HeroicAutoMapperConfigurator.LoadMapsFromCallerAndReferencedAssemblies(x => x.Name.StartsWith("YourPrefix"));
            HeroicAutoMapperConfigurator.LoadMapsFromCallerAndReferencedAssemblies();
        }
    }
}

代码来自该项目:

https://github.com/MattHoneycutt/HeroicCRM

我没有在应用程序中更改任何代码。有没有人有什么建议?

用户名

在GoDaddy,他们说从头开始完全重建了我的帐户,尽管我不确定这到底意味着什么。另外,我将我的网站从Visual Studio重新发布到了生产虚拟主机帐户,这些东西共同解决了该问题。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

重写成员时违反了继承安全性规则:'Autofac.Integration.WebApi.AutofacWebApiDependencyResolver.BeginScope()'

来自分类Dev

解决Autofac问题重写成员GetService时违反继承安全性规则

来自分类Dev

错误:类型违反了继承安全规则:'System.Web.WebPages.Razor.WebPageRazorHost'

来自分类Dev

System.Data.Spatial或System.Data.Entity.Spatial

来自分类Dev

类型“上下文”不继承自“ System.Data.Entity.Migrations.DbMigrationsConfiguration”。EF迁移

来自分类Dev

通过发行版构建项目时找不到System.Data.Entity dll

来自分类Dev

从“ System.Data.Entity.Spatial.DbGeography”上的“ WellKnownValue”获取值时出错

来自分类Dev

序列化类型为'System.Data.Entity.DynamicProxies'的对象时检测到循环引用

来自分类Dev

序列化类型为'System.Data.Entity.DynamicProxies的对象时,检测到循环引用

来自分类Dev

DbContext必须可转换为System.Data.Entity.DbContext

来自分类Dev

找不到System.Data.Entity.DbContext作为参考添加

来自分类Dev

Peta Poco和System.Data.Entity.Spatial.DbGeography

来自分类Dev

如何避免System.Data.Entity.Infrastructure.DbUpdateException

来自分类Dev

如何处理System.Data.Entity.Validation.DbEntityValidationException?

来自分类Dev

System.Data.Entity.DbContext can't find to add as a reference

来自分类Dev

详细信息视图显示“ System.Data.Entity.DynamicProxies

来自分类Dev

Mono中的System.Data.Entity.Design.PluralizationServices错误

来自分类Dev

如何解决此“ System.Data.Entity.DynamicProxies”错误

来自分类Dev

System.Data.Entity.Spatial.DbGeography带有标高的距离

来自分类Dev

Linq查询中的“ System.Data.Entity.Core.EntityCommandExecutionException”

来自分类Dev

C#无法转换system.data.entity集

来自分类Dev

Mono中的System.Data.Entity.Design.PluralizationServices错误

来自分类Dev

Linq查询中的'System.Data.Entity.Core.EntityCommandExecutionException'

来自分类Dev

System.Data.Entity.Spatial.DbGeography带有标高的距离

来自分类Dev

ASP.NET MVC System.Data.Entity.Core.EntityCommandExecutionException

来自分类Dev

savechanges方法中的“ System.Data.Entity.Infrastructure.DbUpdateException”

来自分类Dev

迁移时如何避免System.Data.Entity.Infrastructure.DbUpdateException

来自分类Dev

MVC EF - System.Data.Entity.Infrastructure.DbUpdateException

来自分类Dev

System.Data.Entity.Infrastructure.DbRawSqlQuery<> 不包含“包含”的定义

Related 相关文章

  1. 1

    重写成员时违反了继承安全性规则:'Autofac.Integration.WebApi.AutofacWebApiDependencyResolver.BeginScope()'

  2. 2

    解决Autofac问题重写成员GetService时违反继承安全性规则

  3. 3

    错误:类型违反了继承安全规则:'System.Web.WebPages.Razor.WebPageRazorHost'

  4. 4

    System.Data.Spatial或System.Data.Entity.Spatial

  5. 5

    类型“上下文”不继承自“ System.Data.Entity.Migrations.DbMigrationsConfiguration”。EF迁移

  6. 6

    通过发行版构建项目时找不到System.Data.Entity dll

  7. 7

    从“ System.Data.Entity.Spatial.DbGeography”上的“ WellKnownValue”获取值时出错

  8. 8

    序列化类型为'System.Data.Entity.DynamicProxies'的对象时检测到循环引用

  9. 9

    序列化类型为'System.Data.Entity.DynamicProxies的对象时,检测到循环引用

  10. 10

    DbContext必须可转换为System.Data.Entity.DbContext

  11. 11

    找不到System.Data.Entity.DbContext作为参考添加

  12. 12

    Peta Poco和System.Data.Entity.Spatial.DbGeography

  13. 13

    如何避免System.Data.Entity.Infrastructure.DbUpdateException

  14. 14

    如何处理System.Data.Entity.Validation.DbEntityValidationException?

  15. 15

    System.Data.Entity.DbContext can't find to add as a reference

  16. 16

    详细信息视图显示“ System.Data.Entity.DynamicProxies

  17. 17

    Mono中的System.Data.Entity.Design.PluralizationServices错误

  18. 18

    如何解决此“ System.Data.Entity.DynamicProxies”错误

  19. 19

    System.Data.Entity.Spatial.DbGeography带有标高的距离

  20. 20

    Linq查询中的“ System.Data.Entity.Core.EntityCommandExecutionException”

  21. 21

    C#无法转换system.data.entity集

  22. 22

    Mono中的System.Data.Entity.Design.PluralizationServices错误

  23. 23

    Linq查询中的'System.Data.Entity.Core.EntityCommandExecutionException'

  24. 24

    System.Data.Entity.Spatial.DbGeography带有标高的距离

  25. 25

    ASP.NET MVC System.Data.Entity.Core.EntityCommandExecutionException

  26. 26

    savechanges方法中的“ System.Data.Entity.Infrastructure.DbUpdateException”

  27. 27

    迁移时如何避免System.Data.Entity.Infrastructure.DbUpdateException

  28. 28

    MVC EF - System.Data.Entity.Infrastructure.DbUpdateException

  29. 29

    System.Data.Entity.Infrastructure.DbRawSqlQuery<> 不包含“包含”的定义

热门标签

归档