奇怪的 IIS 10 錯誤

奇怪的 IIS 10 錯誤

即使是簡單的 ASPX 頁面,我的開發 PC 上也會出現奇怪的 IIS 錯誤(Windows 10 Professional、IIS 10):

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Test Page</title>
</head>
<body>
<h1>Testing</h1>
</body>
</html>

任何 ASPX 頁面(包括上面的頁面)都會傳回 500 錯誤,並帶有以下異常/堆疊追蹤:

[IOException: The file cannot be accessed by the system.
]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +1143
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1242
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +126
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.get_CompilerName() +130
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) +826
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +185
   System.Web.Compilation.AssemblyBuilder.Compile() +2032
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +357
   System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +12029645
   System.Web.Compilation.BuildManager.CompileGlobalAsax() +52
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +341

[HttpException (0x80004005): The file cannot be accessed by the system.
]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +76
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +631
   System.Web.Compilation.BuildManager.CallAppInitializeMethod() +38
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +758

[HttpException (0x80004005): The file cannot be accessed by the system.
]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737

系統在大約 6 天前一直可以正常運作:唯一的變更是最新的 Windows 更新(版本 1903)——是的,並沒有排除這種可能性。

舊的 .ASP 頁面可以正確加載,並且我已經驗證系統正在加載/訪問 ASPX 設定檔(web.config、global.asax 等)。

也嘗試卸載/重新安裝IIS,但無濟於事。

答案1

找到了! Sheesh:我的 IIS 目錄路徑包含在 dropbox 中,dropbox 決定智慧同步一些 roslyn 檔案。因此 IIS 無法存取它們,因為這些名稱只是佔位符。

相關內容