1

방금 ​​MVC 응용 프로그램을 작성하여 실험실에서 작동 시켰습니다. 이제 GoDaddy에 배포 했으므로 다음 오류가 발생합니다.배포시 SecurityException이 발생했습니다.

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: Request failed.

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.

스택 추적 : 오류가 데이터베이스에있는 모든 문제를 제안하지 않는 것 비록

[SecurityException: Request failed.] System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +165 System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100 System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +284 System.Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack cs, PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandleInternal rmh, RuntimeAssembly asm, SecurityAction action) +70 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) +0 System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) +70 System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +40 System.Type.GetType(String typeName) +30 System.CodeDom.Compiler.CompilerInfo.get_IsCodeDomProviderTypeValid() +12 System.Web.Compilation.CompilationUtil.GetRecompilationHash(CompilationSection ps) +2175 System.Web.Configuration.CompilationSection.get_RecompilationHash() +96 System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDateInternal(Int64 cachedHash) +458 System.Web.Compilation.BuildManager.CheckTopLevelFilesUpToDate(Int64 cachedHash) +51 System.Web.Compilation.BuildManager.ExecutePreAppStart() +135 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +531

나는 나의 데이터베이스 연결 문자열에 대해 궁금해했다.

내 진짜 질문은 다음과 같습니다. 어떻게 문제를 해결할 수 있습니까? 메시지는 실제로 전혀 도움이되지 않는 것처럼 보입니다. 다음 단계는 무엇일까요?

+0

MVC-5를 사용하고 있습니까? –

+0

@StephenMuecke : 방금 Visual Studio의 최신 버전으로 업그레이드 했으므로 최신 버전을 사용하고 있습니다. –

+0

MVC-5라고 가정합니다. 나는 GoDaddy 호스팅에 대해 아무것도 모르고 그들이 어떤 신뢰 수준을 지원하는지, MVC-5가 중간 신뢰를 더 이상 지원하지 않는다는 사실과 관련 될 수 있습니다. ([이 답변을 참조하십시오] (http://stackoverflow.com/questions/) 25347092/deploying-asp-net-mvc-project/25354496 # 25354496)) –

답변

2

이 내 응용 프로그램을 구축하기 위해 사용하고 .NET의 버전과 호스트에 제공 한 사이에 불일치로 문제가 될 것으로 보인다.

근본적인 문제가 무엇인지 알려주지 않는 다른 오류 메시지를 보내 주셔서 감사합니다.

2

문제가 "신뢰 수준"인 것처럼 보입니다. 사이트의 web.config에 필요한 트러스트 레벨을 지정해야합니다. 그러나 문제는 GoDaddy가 사이트에 필요한 신뢰 수준을 허용하지 않을 수도 있다는 것입니다. 신뢰 수준 중 하나는 허용/거부합니다. 반사 (예 : IoC 컨테이너는 리플렉션 또는 AutoMapper를 사용함).

트러스트 수준은 Microsoft가 더 이상 지원하지 않는다고 말한 것으로서 보안을 해제하는 버그 수정 등은 더 이상 수정되지 않습니다. 한 가지 해결책은 web.config를 변경해도 다른 웹 호스트가 문제를 해결할 수 없다는 것입니다.

예 구성은 :

<system.web> 
    <securityPolicy> 
    <trustLevel name="Full" policyFile="internal"/> 
    </securityPolicy> 
</system.web> 
+0

GoDaddy에 대한 자세한 내용은 https://en.godaddy.com/help/what-trust-level-can을 참조하십시오. -i-use-running-aspnet-2531 – Hyperdingo

+0

설정에 들어갈 때 CAS 신뢰 수준이 Full로 설정되어 있습니다. 그래서 내가 그것을 이해할 정도로, 그것은 문제가되지 않는 것 같습니다. –

+0

나의 나쁜, 필자는 이전에 내 자신의 원인에 대해 이것을 조사 해왔다. 그리고 그것이 문제라고 확신했다.이 기사는 사이트가 자체 애플리케이션 풀 아래에 있지 않기 때문일 수도 있다고 말한다. 확인을 위해 접근 할 수있는 것이 있습니까? https://support.microsoft.com/en-us/kb/555466 아직도 도움이되지 않으면 죄송합니다. – Hyperdingo

관련 문제