Make MSDeploy (Visual Studio) not delete App_Data folder but delete everything else

前端 未结 7 708
一整个雨季
一整个雨季 2020-11-30 19:42

I\'m using Visual Studio\'s Publish button to deploy my website, and want a different App_Data folder on the server. There\'s a checkbox for Leave extra f

相关标签:
7条回答
  • 2020-11-30 20:39

    For asp.net core web apps use MsDeploySkipRules in csproj.

    <ItemGroup>
      <MsDeploySkipRules Include="CustomSkipFile">
        <ObjectName>filePath</ObjectName>
        <AbsolutePath><dir_name>\\app_data</AbsolutePath>
      </MsDeploySkipRules>
      <MsDeploySkipRules Include="CustomSkipFile">
        <ObjectName>dirPath</ObjectName>
        <AbsolutePath><dir_name>\\app_data</AbsolutePath>
      </MsDeploySkipRules>
    </ItemGroup>
    

    Replace <dir_name> with your root folder

    https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/visual-studio-publish-profiles?view=aspnetcore-2.1#exclude-files

    0 讨论(0)
提交回复
热议问题