Visual Studio 2015 Excluded from Build - visual-studio

When I'm working with a VS project, when I want to build some files but not the others, I would go to Solution Explorer, right click on the files I don't want to build, Properties, and set Excluded from Build to "Yes". I find it cumbersome to do this for a dozen files. Is there a shortcut or a better way to do this? Thanks.

Related

switch built targets in visual studio

I was a CLION user for long, and until recently I switched to visual studio 2017 since CLION uses too much memory.
In CLION, basically I can cmake the whole project with the top-level cmake file and generates multiple targets to select from a drop-down button.
I did the same in visual studio except in visual studio I need to run the cmake first to generate a .sln file and open it in visual studio.
After open this, I can see different class instances(my targets) in the solution explorer, but I do not know where to specify which target to run. Each of my target has its own main function. Also, I have integrates all my targets into a top level object called BUILD_ALL. I can build this build_all which builds all of my individual target. But still i dont know how to run each one.
I tried by using the right-click and start a new instance, but it rebuilds the target everytime which is not wanted. In Clion, this is not a problem.
Could someone help on this?
Thanks in advance.
I would suggest using the Set as Startup Project option. This will make it so the build and debug shortcuts target the selected project.
Right click on the project in the solution explorer and choose Set as Startup Project
Another option is to just build and or debug the project directly from the right click context menu.
Depending on how much you work with CMake and Visual Studio you may want to look into VS_STARTUP_PROJECT

Visual Studio menu is missing the "Clean" option?

I have a metadata file error that I am attempting to fix. One of the solutions that I want to attempt is to individually clean and rebuild the projects. I see two solutions that should work:
Right click on the project individually and select clean.
select the project, select build from the menu, select clean 'projectname'
The problem that I have is that the right click context menu is not showing clean. It shows build and rebuild but not clean.
In the build menu, it only shows options to clean / build the entire solution, no matter what I currently have selected.
I have done the rebuild on each project individually, but the Metadata error is still there.
What can I do to get the options to clean an individual project?
You can always do a "manual" clean of a project by deleting both bin and obj -folders from the projects folder. Sometimes the Clean-feature in Visual Studio doens't do decent enough job so I do this:
Note: Sometimes Visual Studio is using files from these folders so you can't have the project open and delete. Close Visual Studio and delete the folders by hand from the folder and reopen Visual Studio.

How do you exclude a folder from build in Visual Studio 2015?

I have an example project from a vendor, and in the instructions, I'm told to right-click a folder in the Solution and select "exclude from build." But there's no such feature in VS 2015, and I can't find an equivalent online.
I've tried to just remove the folders from the project, and I expected that to work, but then I get compilation errors, so I suspect there are some dependencies that don't allow that solution to work.
You should see an option for Exclude from Project, when you right click a folder in solution explorer. Following screenshot displays this.

Build specific configuration

Is there any Visual Studio extension available, that allows you to right-click a solution/project in the solution explorer and build as a specific configuration?
I find Visual Studio extremely slow at changing configuration, which is why I usually rely on running MSBuild directly.
A context menu below the Build action with all the configurations available would be quite nice.
Any suggestions?
In the main menu, select Build->Batch Build... and select the configuration/platform combination(s) you want to build. It's not ideal when you have a lot of projects though.

How do I create a project in Visual Studio not meant to compile?

I've got a Visual Studio 2010 solution that I would like to add a project to that only contains some command-line scripts. This project isn't meant to actually compile/build anything, but I want to be able to edit my scripts with the rest of the solution, and have TFS integration etc.
Unfortunately, in searching I get a lot of results for errors where builds don't happen, or other conditions where specific build targets are implemented. I simply want a non-build project in VS as a visual repository for the editor. I don't want to one-by-one include individual files in a solution folder.
In the build configuration manager (On the Menu, "Build", "Configuration Manager"), there is a "build" checkbox for each project. Uncheck it for your script project.
Could you make a content project, add your scripts to it, then change their properties to "Do not compile"?

Resources