# .Net 6 IIS陰影複製 ###### tags: `IIS` `.net core` `.net` ##### [來源連結](https://blog.miniasp.com/post/2021/11/13/ASPNET-Core-6-Shadow-copying-in-IIS) 陰影複製主要在於佈板時可以不受檔案綁定影響,以及使用者不會受到布板而中斷使用體驗(站台複製時還是會有等待時間),Web.Config 加入陰影複製的設定,及安裝[ASP.NET Core 6.0 的 Hosting Bundle](https://dotnet.microsoft.com/en-us/download/dotnet/6.0) ![](https://i.imgur.com/OHOb4cb.jpg) ### Web.config 主要在於加入handlerSetting的部分,有使用Log時需要將Log移出WebSite的資料夾Logs太大而增加過多複製的時間 ``` <?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\MeetingManage.dll" stdoutLogEnabled="true" stdoutLogFile="..\MeetMangelogs\stdout" hostingModel="inprocess"> <environmentVariables> <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" /> </environmentVariables> <handlerSettings> <handlerSetting name="experimentalEnableShadowCopy" value="true" /> <handlerSetting name="shadowCopyDirectory" value="../ShadowCopyDirectory/" /> <!-- Only enable handler logging if you encounter issues--> <!-- <handlerSetting name="debugFile" value="../ShadowCopyLogs/aspnetcore-debug.log" /> --> <!-- <handlerSetting name="debugLevel" value="FILE,TRACE" /> --> </handlerSettings> </aspNetCore> </system.webServer> </location> </configuration> <!--ProjectGuid: 70f92c01-51f1-40f5-8520-ea54cdfa6aee--> ```