gpt4 book ai didi

deployment - 使用 AppVeyor : file locked by external process (Appveyor agent) 部署 .NET Core 应用程序

转载 作者:行者123 更新时间:2023-12-04 21:08:18 27 4
gpt4 key购买 nike

我正在尝试使用 Appveyor 代理在服务器上部署一个项目。但是,如果我在部署前不重新启动或停止应用程序,则它不起作用。

Web Deploy cannot modify the file 'TestProject.Application.dll' on the destination because it is locked by an external process.  In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt.  Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.

有没有一种简单的方法来处理 app_offline.htm 文件?使用“app_offline”功能的 appveyor.yml 配置在这种环境中不起作用。

我在“之前/之后”部分寻找一些东西。这是我的 appveyor.yml:
version: '1.0.{build}'
os: Visual Studio 2015

install:
- "SET PATH=C:\\Program Files\\dotnet\\bin;%PATH%"

branches:
only:
- master

assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '{version}'
assembly_file_version: '{version}'
assembly_informational_version: '{version}'

build_script:
- nuget sources add -name "VNext" -source https://dotnet.myget.org/F/cli-deps/api/v3/index.json
- nuget sources add -name "nugetv3" -source https://api.nuget.org/v3/index.json
- dotnet restore
- dotnet build */*/project.json

after_build:
- ps: Remove-Item -Path src\TestProject.Web\web.config
- ps: Move-Item -Path src\TestProject.Web\web.$env:APPVEYOR_REPO_BRANCH.config -Destination src\TestProject.Web\web.config
- dotnet publish src\TestProject.Web\ --output %appveyor_build_folder%\publish

artifacts:
- path: .\publish
name: TestProject.Web

test: off

deploy:
- provider: Environment
name: east-webhost
artifact: TestProject.Web
remove_files: false
on:
branch: master

最佳答案

请看before/after deploy scripts .还要检查this sample关于如何确保该文件已发布。

——伊利亚。

关于deployment - 使用 AppVeyor : file locked by external process (Appveyor agent) 部署 .NET Core 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40347509/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com