使用WebDeploy發(fā)布程序后文檔xml文件丟失,導(dǎo)致swagger無法正確打開
國外也有這方面的討論但是最終都沒有有效的解決方案
或者 方案不是針對.NET 4.5的
研究了一下等到一個(gè)比較靠譜的方案
修改發(fā)布文件 *.pubxml
增加下面2段配置披摄,問題解決,現(xiàn)在可以順利將xml文件發(fā)布到服務(wù)器了
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
...
</PropertyGroup>
<Target Name="CustomCollectFiles">
<ItemGroup>
<_CustomFiles Include="bin\**\*.xml" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>%(RecursiveDir)bin\%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<PropertyGroup>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
CustomCollectFiles;
$(CopyAllFilesToSingleFolderForMsdeployDependsOn);
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
</Project>