Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# '中的服务器错误/';应用程序文件加载异常_C#_Dll_Azure Devops_Azure Web App Service - Fatal编程技术网

C# '中的服务器错误/';应用程序文件加载异常

C# '中的服务器错误/';应用程序文件加载异常,c#,dll,azure-devops,azure-web-app-service,C#,Dll,Azure Devops,Azure Web App Service,我在尝试打开网站时出错。它在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. 这是堆栈跟踪: [F

我在尝试打开网站时出错。它在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

[InvalidOperationException: The pre-application start initialization method Run on type webActivatorEx.ActivationManager threw and exceoption with the following error message: Could not load file or assembly 'file:///D: \home\site\wwroot\bin\App_web_orhmujnn.dll' or one of its dependencies. Access id denied..]
 System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +613
 System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +138
 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +164
 System.Web.Compilation.BuildManager.ExecutePreAppStart() +156
 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +695


[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivatorEx.ActivationManager threw an exception with the following error message: 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.Web.HttpRuntime.FirstRequestInit(HttpContext context) +656
 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +89
 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +189
在页面上执行Ctrl+F5有时会返回不同的dll,但大部分错误保持不变


我已经检查了Azure Devops构建设置,并与以前工作的构建进行了匹配。web配置和csproj也与以前的工作版本相匹配。我还检查了除我之外的其他个人电脑上的站点,同样的错误正在发生

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

在您的本地主机中是否存在
file:///D:\home\site\wwwroot\bin\App\u Web\u或hmujnn.dll
?是的,我可以看到该文件,您从哪里获得该文件?斯文切克?