为了账号安全,请及时绑定邮箱和手机立即绑定

“/”应用程序文件加载异常中的服务器错误

“/”应用程序文件加载异常中的服务器错误

C#
呼啦一阵风 2023-08-13 16:17:16
我在尝试打开该网站时遇到错误。它在 Visual Studio 中运行良好,在本地发布时也运行良好,但在 Azure Devops 中构建时出现此错误:Server Error in '/' Application.Could not load file or assembly 'file:///D:\home\site\wwwroot\bin\App_Web_orhmujnn.dll' or one of its dependencies. Access is denied.这是堆栈跟踪:[FileLoadException: Could not load file or assembly 'file:///D:\home\site\wwwroot\bin\App_Web_orhmujnn.dll' or one of its dependencies. Access is denied.] System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +36 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152 System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) +102 System.Reflection.Assembly.LoadFrom(String assemblyFile) +34 WebActivatorEx.ActivationManager.get_Assemblies() +187 WebActivatorEx.ActivationManager.RunActivationMethods(Boolean designerMode) +97 WebActivatorEx.ActivationManager.RunPreStartMethods(Boolean designerMode) +36 WebActivatorEx.ActivationManager.Run() +75在页面上执行 Ctrl + F5 有时会返回不同的 dll,但大部分错误没有改变我已经检查了 Azure Devops 构建设置并与之前工作的构建相匹配。Web 配置和 csproj 也与之前的工作版本匹配。我还在我以外的电脑上检查了该网站,也出现了同样的错误
查看完整描述

1 回答

?
江户川乱折腾

TA贡献1851条经验 获得超5个赞

清除 wwwroot\bin 中的所有内容修复了重建后的问题。Azure 上的应用服务中有一个控制台,可以在其中清空目录



查看完整回答
反对 回复 2023-08-13
  • 1 回答
  • 0 关注
  • 146 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信