原來運行正常的站點,突然不正常了,出現503錯誤。查看操作系統的日志查看器顯示:
由於配置問題,無法加載模塊 DLL“C:\Program Files (x86)\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll”。當前配置僅支持加載為 x86 處理器架構構建的映像。數據字段包含錯誤號。要了解有關此問題的更多信息,包括如何解決這類處理器架構不匹配錯誤,請參見 http://go.microsoft.com/fwlink/?LinkId=29349。
從這里基本就可以看出來是站點配置文件的問題了,先查站點下的web.config里,看下有沒有"aspnetcorev2"的字樣,如果沒有,就繼續往跟上找,做asp.net開發的都知道iis的配置,是逐層繼承合並的,於是找到了:
打開這個文件再搜索,你會發現以下內容:
一共修改以下幾個內容,我摘要出來:
<globalModules>
<add name="AspNetCoreModule" image="%SystemRoot%\system32\inetsrv\aspnetcore.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
<add name="AspNetCoreModuleV2" image="%ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
</globalModules>
<system.webServer>
<modules>
<add name="AspNetCoreModule" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
<add name="AspNetCoreModuleV2" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
</modules>
</system.webServer>