Omtechguy
Omtechguy

Reputation: 3651

How to exlude file from beeing published in Visual Studio

I would like to add some documentation files to my Visual Studio 2013 project (not solution) and would like to make sure that that files will not be published as part of the publishing process.

I can add folder in the solution level but couldn't find a way to do it to a specific project.

Exclude the directory from the project is not good idea for me because i want the developer will see that files when he open the project without asking him to check "Show all files" option.

Upvotes: 0

Views: 59

Answers (2)

Kunal B.
Kunal B.

Reputation: 563

Exclude specific files or folders from deployment?

Add the following to the <profile_name>.pubxml to exclude files and folders.

<PropertyGroup">
  <ExcludeFilesFromDeployment>
    File1.aspx;File2.aspx
  </ExcludeFilesFromDeployment>
  <ExcludeFoldersFromDeployment>
    Folder1;Folder2
  </ExcludeFoldersFromDeployment>
</PropertyGroup>

Upvotes: 1

Oded
Oded

Reputation: 499152

Change the build action of the files - change it from Content to None.

This is done in the file properties (F4).

See What are the various "Build action" settings in Visual Studio project properties and what do they do? for details.

Upvotes: 1

Related Questions