I am trying to publish an ASP.NET Core 5 project using FTP. However, I do not want to publish the App_Data
folder.
Using Visual Studio 2017, I opened the .csproj
file and added the following
<ItemGroup>
<Content Remove="App_Data" />
</ItemGroup>
<ItemGroup>
<Content Update="App_Data">
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<None Remove="App_Data" />
</ItemGroup>
I also added
<ExcludeFoldersFromDeployment>App_Data</ExcludeFoldersFromDeployment>
to the .pubxml
file.
That did not work.
How can I exclude the App_Data
entirely from being published?