2016-07-04 13 views
1

以前は私のウェブサイトが機能していましたが、GoDaddyのASP.NET設定をvbからc#に変更しました。私は他の何かを変えることを思い出さない。 14行目は、 "HeroicAutoMapperConfigurator" でエラーが発生したコードは、ここでメンバをオーバーライドしている間に継承セキュリティルールが違反しました: 'System.Data.Entity.Utilities.TaskExtensions

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 

されています:今、私はこのエラーを取得しています

https://github.com/MattHoneycutt/HeroicCRM:コードは、このプロジェクトからである

[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(); 
     } 
    } 
} 

私のアプリケーションでコードは変更されていません。誰にも何か提案はありますか?

答えて

0

GoDaddyでは、彼らは私のアカウントを完全に再構築したと言っていましたが、その意味がわかりません。また、私はVisual Studioからプロダクションウェブホスティングアカウントに自分のウェブサイトを再公開しました。これらのアカウントが問題を解決しました。

0

問題は信頼レベルに関連しています。共有ホスティングのほとんどは完全な信頼ホスティングを提供しません。起動時に自分自身を有効にしても、Microsoft.Owin.Securityを使用している場合は動作しません。

<appSettings> 
    <add key="owin:AutomaticAppStartup" value="false" /> 

ホスティングを変更することをお勧めします。そうしないと、コードを変更することになります。

関連する問題