.net - Web Deploy automatic backup is empty when using dotnet publish
问题描述
I am using web deploy to publish my .net core 3.1 web app to my server, which is working fine so far. Now I want to setup automatic backup before any new deployments. I followed this manual.
I've also added <EnableMSDeployBackup>True</EnableMSDeployBackup>
to my .pubxml
file.
When I initiate a deployment with dotnet publish ...
The console output tells that a backup will be created. No errors are reported. And actually there is a package zip-file at the defined backup location, but the content folder does not contain anything, there is only an archive.xml
and systemInfo.xml
file in the root of the zip.
When I perform the backup using msdeploy.exe -verb:sync -source:backupManager -dest:backupManager=siteName
directly on the server, the backup is created properly. For testing I'm using the same user for remote-publish who is administrator on the server and has full rights in the source as well as in the destination folder.
The behaviour is the same when publishing from within Visual Studio 2019.
I've already found some similar questions here and here but none of the recommended solutions work.
My .pubxml
looks like this (mostly created from VS):
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<EnvironmentName>Production</EnvironmentName>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://my-server/myapp</SiteUrlToLaunchAfterPublish>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<TargetFramework>net461</TargetFramework>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<ProjectGuid>3ae552b0-7f3a-42b9-b224-d5c734004215</ProjectGuid>
<MSDeployServiceURL>https://my-server/</MSDeployServiceURL>
<DeployIisAppPath>MyApp</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>ourDomain\myUser</UserName>
<_SavePWD>True</_SavePWD>
<PublishDatabaseSettings>
<Objects xmlns="" />
</PublishDatabaseSettings>
<ExcludeFilesFromDeployment>appsettings.Development.json</ExcludeFilesFromDeployment>
</PropertyGroup>
</Project>
Any ideas will be appreciated!
解决方案
推荐阅读
- c# - GET 请求返回 400 错误响应
- abap - BAPI_GOODSMVT_CREATE 调用的强制参数?
- typescript - 泛型类型用作抽象类中的值
- html - 在反应而不是材料 UI 中使用 HTML 进行浮动按钮的问题
- icloud - CardDav(iCloud)补丁禁止响应的原因是什么?
- python - 在 numpy 数组中搜索
- cmake - CentOS 7 中的 cmake 版本比 CentOS 8 中的更新版本?
- webpack - NodeGit - 无法读取未定义的属性“类型”
- python - 如何正确设置 Django 模板路径?
- azure-maps - Azure Maps - 如何增加最大文本大小/避免自动换行?