IIS設定
This commit is contained in:
1 parent
422a9d8ccc
commit
544f145f4f
2 files changed
+45
-25
No files matched your search
@@ -1,15 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<DeleteExistingFiles>false</DeleteExistingFiles>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<LaunchSiteAfterPublish>false</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||
<PublishProvider>FileSystem</PublishProvider>
|
||||
<PublishUrl>C:\docker\web\</PublishUrl>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<SelfContained>false</SelfContained>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- ① 発行開始前: app_offline.htm を配置して IIS のプロセスを停止し DLL ロックを解除 -->
|
||||
<Target Name="TakeAppOffline" BeforeTargets="BeforePublish">
|
||||
<Message Text="[Deploy] app_offline.htm を配置して IIS プロセスを停止します..." Importance="high" />
|
||||
<WriteLinesToFile File="$(PublishUrl)app_offline.htm"
|
||||
Lines="<html><body>Publishing updates...</body></html>"
|
||||
Overwrite="true" />
|
||||
<!-- プロセスが完全に終了してファイルロックが解放されるまで 2 秒待機 -->
|
||||
<Exec Command="powershell -Command Start-Sleep -Seconds 2" />
|
||||
</Target>
|
||||
|
||||
<!-- ② 発行完了後: app_offline.htm を削除して IIS プロセスを自動起動 -->
|
||||
<Target Name="BringAppOnline" AfterTargets="AfterPublish">
|
||||
<Message Text="[Deploy] app_offline.htm を削除して IIS アプリケーションを復帰します..." Importance="high" />
|
||||
<Delete Files="$(PublishUrl)app_offline.htm" />
|
||||
</Target>
|
||||
</Project>
|
||||
Reference in new issue
Block a user