部署时抛出SecurityException [英] SecurityException thrown on deployment

查看:97
本文介绍了部署时抛出SecurityException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚编写了一个MVC应用程序,并使其在实验室中可以正常工作。现在,将其部署到GoDaddy上,出现以下错误。

I have just written an MVC application and got it working in my lab. Now that I've deployed it to GoDaddy, I am getting the following error.


说明:应用程序尝试执行不允许的操作通过安全策略。要授予此应用程序所需的权限,请与您的系统管理员联系,或在配置文件中更改应用程序的信任级别。

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.

异常详细信息:System.Security.SecurityException:请求失败。

Exception Details: System.Security.SecurityException: Request failed.

源错误:生成了未处理的异常在执行当前Web请求期间。可以使用下面的异常堆栈跟踪来标识有关异常的来源和位置的信息。

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:请求失败。]
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm,已授予PermissionSet,PermissionSet被拒绝,RuntimeMethodHandleInternal rmh,SecurityAction操作,对象需求,IPermission permThatFailed)+165
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(对象assemblyOrString,授予的PermissionSet,权限集被拒绝,RuntimeMethodHandleInternal rmh,SecurityAction操作,对象需求,IPermission permThatFailed)+100
系统。 Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet授予,PermissionSet被拒绝,PermissionSet需求,RuntimeMethodHandleInternal rmh,Object assemblyOrString,SecurityAction操作,布尔型throwException)+284
系统。 Security.CodeAccessSecurityEngine.CheckSetHelper(CompressedStack CS,PermissionSet授予,PermissionSet被拒绝,PermissionSet要求,RuntimeMethodHandleInternal rmh,RuntimeAssembly asm,SecurityAction操作)+70
System.RuntimeTypeHandle.GetTypeByName(字符串名称,布尔throwOnError,布尔ignorelyCase,布尔值,StackCrawlMarkHandle stackMark,IntPtr pPrivHostBinder,布尔值loadTypeFromPartialName,ObjectHandleOnStack类型)+0
System.RuntimeTypeHandle.GetTypeByName(字符串名称,布尔型throwOnError,布尔值ignoreCase,布尔值仅反射,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,布尔值loadTypeFromPartialName)+70
System.RuntimeType.GetType(字符串类型名称,布尔型throwOnError,布尔值ignoreCase,布尔反射仅,StackCrawlMark& stackMark)+40
System.Type.GetType(字符串类型名称) )+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
系统。 Web.Compilation.BuildManager.ExecutePreAppStart()+135
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParamete rs hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException)+531

[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

我想知道我的数据库连接字符串,尽管错误似乎没有建议数据库有任何问题。

I wondered about my database connection string, although the error doesn't seem to suggest any issue with the database.

所以我真正的问题是:如何解决此问题。这些消息似乎根本没有帮助。下一步可能是什么?

So my real question is: How does one go about troubleshooting this. The messages don't really seem to help at all. What could be a next step?

推荐答案

这似乎是我所使用的.NET版本之间不匹配的问题

This appears to be an issue with a mismatch between the version of .NET I'm using to build my app and the one provided on the host.

感谢Microsoft提供的另一条错误消息,该错误消息似乎对根本问题一无所知。

Thank you Microsoft for another error message that seems to tell me nothing about what the underlying issue is.

这篇关于部署时抛出SecurityException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆