MVC .NET +服务器部署问题

如何解决MVC .NET +服务器部署问题

| 我已经使用FTP995将数据库以及文件上传到服务器。我使用的是托管服务器Go Daddy,他们对他们支持的所有应用程序的信任级别为“中”, 当我尝试运行我的网站时,它甚至没有显示登录页面...
throwing exception

System.Security.Policy.PolicyException: required permissions cannot be acquired.
错误:   执行过程中产生了未处理的异常   当前的Web请求。有关原产地和位置的信息   可以使用下面的异常堆栈跟踪来识别异常。 堆栈跟踪:
[PolicyException: required permissions cannot be acquired.]
   System.Security.SecurityManager.ResolvePolicy(Evidence evidence,PermissionSet reqdPset,PermissionSet optPset,PermissionSet denyPset,PermissionSet& denied,Boolean checkExecutionPermission) +7606579
   System.Security.SecurityManager.ResolvePolicy(Evidence evidence,Int32& securitySpecialFlags,Boolean checkExecutionPermission) +57

[FileLoadException: Could not load file or assembly \'Microsoft.ReportViewer.Common,Version=9.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a\' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Reflection.Assembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,Assembly locationHint,StackCrawlMark& stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection) +0
   System.Reflection.Assembly.nLoad(AssemblyName fileName,Boolean forIntrospection) +43
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,Boolean forIntrospection) +127
   System.Reflection.Assembly.InternalLoad(String assemblyString,Boolean forIntrospection) +142
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +46

[ConfigurationErrorsException: Could not load file or assembly \'Microsoft.ReportViewer.Common,PublicKeyToken=b03f5f7f11d50a3a\' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +613
   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
   System.Web.Compilation.buildprovidersCompiler..ctor(VirtualPath configPath,Boolean supportLocalization,String outputAssemblyName) +54
   System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir,CodeDirectoryType dirType,String assemblyName,StringSet excludedSubdirectories,Boolean isDirectoryAllowed) +600
   System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir,StringSet excludedSubdirectories) +128
   System.Web.Compilation.BuildManager.CompileResourcesDirectory() +31
   System.Web.Compilation.BuildManager.EnsuretopLevelFilesCompiled() +304

[HttpException (0x80004005): Could not load file or assembly \'Microsoft.ReportViewer.Common,PublicKeyToken=b03f5f7f11d50a3a\' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
   System.Web.Compilation.BuildManager.EnsuretopLevelFilesCompiled() +512
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters) +729

[HttpException (0x80004005): Could not load file or assembly \'Microsoft.ReportViewer.Common,PublicKeyToken=b03f5f7f11d50a3a\' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
   System.Web.HttpRuntime.FirstRequestinit(HttpContext context) +8894031
   System.Web.HttpRuntime.EnsureFirstRequestinit(HttpContext context) +85
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
................................................... .................................... 之后,我将信任级别= \“ Medium \”,
<trust level=\"Medium\" />
放入我的
web.config
中并再次部署。 然后显示错误为   说明:在处理文件时发生错误   服务此请求所需的配置文件。请查看   下面的特定错误详细信息并修改您的配置文件   适当地。      解析器错误消息:无法在以下位置使用此配置部分   这条路。当站点管理员锁定访问权限时,会发生这种情况   使用   继承的配置文件。 源错误
Line 157:      <add name=\"UrlRoutingModule\" type=\"System.Web.Routing.UrlRoutingModule,System.Web.Routing,Version=3.5.0.0,PublicKeyToken=31BF3856AD364E35\"/>
Line 158:    </httpModules>
Line 159:    <trust level=\"Full\" />
Line 160:  </system.web>
Line 161:  <system.codedom>

Source File: D:\\Hosting\\7734726\\html\\web.config    Line: 159
    

解决方法

阅读错误消息。 [FileLoadException:无法加载文件或程序集'Microsoft.ReportViewer.Common,版本= 9.0.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a \'或其依赖项之一。无法授予最低权限请求。 (来自HRESULT的异常:0x80131417) 您试图以中等信任度使用程序集,但无法以中等信任度运行。 (Microsoft.ReportViewer.Common) 3个解决方案 A)要求您的托管服务提供商将Microsoft.ReportViewer程序集安装到GAC中(这可能会有所帮助),但他们可能不愿意这样做 B)寻找一个完全信任或类似的新托管环境 要么 B)重写您的应用程序,使其不依赖于该程序集。 如果要开发要部署到中等信任环境中的应用程序,则在开发应用程序时应设置trust = \“ medium \”,以便在开发过程中发现任何此类问题,而不是进行部署。     ,您是否尝试过直接通过Visual Studio发布功能部署网站? 可能是您的FTP客户端设置了错误的权限。 如果您的报告程序集无法以媒体信任的方式运行,那就去找一个更好的托管服务提供商吧,那里有很多服务提供商:)     

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?