Todd Sparks
Todd Sparks

Reputation: 13

Exclude folders when publishing

It is possible to exclude folders from my publish process when deploying my ASP.NET Core application?

Specifically, the bootstrap/js files. These files very rarely change but have made my publish process take forever. I'd like to just be able to exclude them until I know that they have changed.

Upvotes: 1

Views: 2339

Answers (2)

Md Farid Uddin Kiron
Md Farid Uddin Kiron

Reputation: 22419

To exclude specific files from deployment, you could follow below steps:

  • In the Solution Explorer window, right-click the file, and then click Properties.

See the screenshot below:

enter image description here

  • In the Properties window, in the Build Action row, select None

See the screenshot below:

enter image description here

Note: Once you implement above changes your selected file will be excluded from the deployment. You can also do that using XML command on your project csproj file. You can have a look on official guideline for further details.

Upvotes: 2

YoussefSell
YoussefSell

Reputation: 157

in Visual Studio select the files you want to exclude, right-click -> properties then the properties window will be opened, in the Build Action choose None.

Upvotes: 0

Related Questions