Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude files from Visual Studio compile?

I'm in the process of refactoring a project. I've got an entire subfolder which is known to be broken. Is there any declarative way to exclude that folder from the compile temporarily while I test the refactoring thus far?

I realize I could delete the folder, but I'd like to do this through configuration if possible.

like image 969
Larsenal Avatar asked Oct 20 '08 18:10

Larsenal


People also ask

How do I exclude codes in Visual Studio?

You can use the exclude folder option to remove unwanted folders like node_modules or others you don't want to open in Visual Studio Code. To exclude a folder, go to File > Preferences, and search for file. exclude in the search settings. You can add the pattern of the folder you don't want Visual Studio Code to open.

What is exclude file?

If you exclude a file from a Web Site project (not Web Application), Visual Studio will simply add the . exclude extension to that file. If you remove the extension, that file will be included again. It's up to you if you still need those files or not.

How do I hide excluded files in Visual Studio?

Yes, there is a button to hide/show excluded files. The button is under solution explorer tab. Important Update: After trials on VS2012 I found out that if you create New Web Site the hide/show button will not appear for no apparent reason.

How exclude files from VS code search?

Persistent Exclusions From menu choose File ➡️ Preferences ➡️ Settings ➡️ User/Workspace Settings and filter default settings to search . You can modify the search. exclude setting (copy from default setting to your user or workspace settings). That will apply only to searches.


1 Answers

You could set the Build Action (in the Properties Window) to None for the files you want excluded. You could also right-click on the folder and choose Exclude from Project.

like image 100
Rob Windsor Avatar answered Sep 25 '22 19:09

Rob Windsor