2016-10-31 69 views
5

Bir sunucu üzerinde bir projeyi Anket aracısı kullanarak dağıtmaya çalışıyorum. Ancak, dağıtımdan önce uygulamayı yeniden başlatmaz veya durdurmazsam, çalışmaz.AppVeyor ile bir .NET Çekirdeği uygulaması dağıtın: dosya harici işlemle kilitlendi (Aracı)

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. 

Bir app_offline.htm dosyasıyla çalışmanın kolay bir yolu var mı? "app_offline" özelliğini kullanarak appveyor.yml yapılandırması bu tür ortamlarda çalışmaz.

"Before/after" bölümünde bir şey arıyordum. before/after deploy scripts de

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 

cevap

2

bakınız: İşte benim appveyor.yml bu. Ayrıca, dosyanın yayınlanmasını nasıl sağlayabileceğinizi öğrenmek için this sample adresini de kontrol edin.

--ilya.

+0

Projemimin kökünden önce-deploy.ps1'im var ancak yürütmedim, bu konuda herhangi bir düşünce var mı? /deploy.ps1 /src/TestProject.WebApp Bu deploy.ps1 çözümümde "Çözüm öğesi" olarak yer aldım. Sunucuda hala hiçbir şey yapılmadı. –

+3

http://www.gabrielrobert.com/2016/11/blog-post.html –