ASP.NET 5 DNU发布覆盖

时间:2016-05-13 02:43:25

标签: c# asp.net visual-studio asp.net-core

我使用Jenkins发布我的网站但有一些问题

Error: The process cannot access the file 'Microsoft.Extensions.Logging.Debug\1.0.0-rc1-final\lib\net451\Microsoft.Extensions.Logging.Debug.dll' because it is being used by another process.

看起来我的网站正在使用.dll,所以我无法覆盖它。我尝试通过Visual Studio发布它的工作原理。 VS做的是发布到临时文件夹,然后部署到最终路径,有VS的部署命令

Publishing with publish method [FileSystem]
Publishing files to C:\inetpub\HubbleRebuild
Executing command ["C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:contentPath='\PublishTemp\Website52\' -dest:contentPath='C:\inetpub\Website' -verb:sync -enableRule:DoNotDeleteRule -retryAttempts:2 -disablerule:BackupRule]

首先,我想在发布时覆盖但我发现这个dnu publish should handle --out pointing to an existing directory。现在看起来不支持。所以我认为我需要按照VS方式发布,另一个问题是如何在部署时覆盖以及如何定义我不想覆盖的文件。

1 个答案:

答案 0 :(得分:0)

最后我在Jenkins上使用2个命令发布我的网站,效果很好。

1.dnu pulibsh到临时文件夹

2.将此临时文件夹部署到目标网站

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:contentPath='\PublishTemp\Website52\' -dest:contentPath='C:\inetpub\Website' -verb:sync -enableRule:DoNotDeleteRule -retryAttempts:2 -disablerule:BackupRule

但是当我使用命令失败时,我的Jenkins服务器没有 Microsoft Web Deploy V3 Microsoft Web Deploy ,因为disablerule:BackupRule之后我删除了这部分它的工作。

日志文件不会覆盖,新功能会更新。