報錯信息如下: 註:為了部分隱私安全需要,已將有問題文件名替換為filename,系統win2008R2,Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.2623.0 第一開始嘗試過給C:\Windows\Microsoft.NET\Fra ...
報錯信息如下:
註:為了部分隱私安全需要,已將有問題文件名替換為filename,系統win2008R2,Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.2623.0
“/”應用程式中的伺服器錯誤。 未能載入文件或程式集“filename”或它的某一個依賴項。拒絕訪問。 說明: 執行當前 Web 請求期間,出現未經處理的異常。請檢查堆棧跟蹤信息,以瞭解有關該錯誤以及代碼中導致錯誤的出處的詳細信息。 異常詳細信息: System.IO.FileLoadException: 未能載入文件或程式集“filename”或它的某一個依賴項。拒絕訪問。 源錯誤: 執行當前 Web 請求期間生成了未經處理的異常。可以使用下麵的異常堆棧跟蹤信息確定有關異常原因和發生位置的信息。 程式集載入跟蹤: 下列信息有助於確定程式集“filename”未能載入的原因。 警告: 程式集綁定日誌記錄被關閉。 要啟用程式集綁定失敗日誌記錄,請將註冊表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)設置為 1。 註意: 會有一些與程式集綁定失敗日誌記錄關聯的性能損失。 要關閉此功能,請移除註冊表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。 堆棧跟蹤: [FileLoadException: 未能載入文件或程式集“filename”或它的某一個依賴項。拒絕訪問。] 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.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +225 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +110 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22 System.Reflection.Assembly.Load(String assemblyString) +34 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +48 [ConfigurationErrorsException: 未能載入文件或程式集“filename”或它的某一個依賴項。拒絕訪問。] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +729 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +247 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +157 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +226 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +73 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +321 System.Web.Compilation.BuildManager.ExecutePreAppStart() +170 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +734 [HttpException (0x80004005): 未能載入文件或程式集“filename”或它的某一個依賴項。拒絕訪問。] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +708 版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.7.2623.0
第一開始嘗試過給C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files添加的everyone許可權,無果,後又將其整個刪除,依然無果。
當然其中也嘗試過其他一些方法,不過後來又到一一還原了,不具參考。
簡單來說,最後發現,就是報錯顯示的這個filename.dll(目錄一般為你網站下的bin目錄內)文件許可權不夠,需要給與添加everyone讀取許可權,
不過事後,我在想截圖留存一張清晰問題圖片的事情,發現再把everyone的許可權取消,iisreset訪問也是ok沒有任何問題的。
完。祝各位一切順利。