Click here to Skip to main content
15,846,346 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'd like to be able to toggle the "Exclude from build" option for a file, without having to go through Right-Click|Properties.

Is there any way to assign this to a button?
AspDotNetDev 20-May-13 20:25pm    
Do you mean "Exclude From Project"? I see that in my context menu when I right click an item.
Kyudos 20-May-13 23:02pm    
No, that removes the file from the project, I want to remove it from the build. See (on a file) Right-click|Properties|General|Excluded from build

1 solution

I think he's saying setting the Build Action to "None".

I don't know that there is a way to do this without creating a VSIP. The only real way to do it is to edit the .csproj or .vbproj file and set the <buildaction> to none. You may want to look through the MSBuild documentation but I'm guessing that making a VSIP is more trouble than opening the properties window and setting the property.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900