Visual Studio menu is missing the "Clean" option? - visual-studio

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.

Related

Visual Studio, Copy files to project directory problem

I have Visual Studio community 2017. coming from eclipse it was just enough to copy file to project directory and hit refresh then files were appearing in project explorer.
In VS, however when I copy some i.e. *.cpp or *.h in windows explorer to project directory, in VS solution explorer I can not see them. switching to folder view I see but can not include them into project.
via drag&drop to solution explorer (project view) I see them but are not part of project and in folder view and actual directory there is nothing.
what is going on with VS? How can I manually copy paste some files into project while they become part of project?
I will note that there's nothing "going on" with Visual Studio in the sense that something is actually wrong with it, it's just that adding files to your project just requires you to actually add them to your solution. Essentially, it allows you to add miscellaneous files to your folders without automatically including them in your build project (for example, if you're working with some test images/files).
To add files/folders to your project you simply right click on your project in the Solution Explorer and then go to Add > Existing Item.... Then, it's just a matter of selecting one (or Ctrl + A/Shift Clicking to select all/multiple files) and then it will add them to your solution.
In the solution explorer pane, click on the show all files button,
it will reveal all files including your pasted file,
Right click on your file and select "include in project".

Building a Folder in Visual Studio

I'm working in Visual Studio 2017. I wanted to open a folder of files, so I clicked File -----> Open ------> Folder and selected the folder containing all my files.
When I view the Solution Explorer, I can see all of my programming files. However, I am unable to build my project and run it. Is there any way to build and run a folder in Visual Studio? I've tried selecting the .cpp file that I wanted to build specifically, but there's still no build/debug option.
In fact, under the Debug menu, the F5 Start option is grayed out. Any solutions?
I think you have to create a Visual Studio project first, and then add those files to the project. What you are doing right now is just using VS as an editor and viewer.

Visual Studio 2015 Excluded from Build

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.

Creating an installer for Visual Studio 2010 solutions (one or more projects)

I ran into some troubles when creating an installer for my Visual Studio 2010 solution (which has multiple projects) so I thought I'd make a quick guide to how I got it working...
Here is how I did it:
Create a new Visual Studio Installer project which is located under
Installed Templates/Other Project Types/Setup and Deployment/Visual Studio Installer.
Make sure you add it to you current solution, you can do this by right clicking on the solution name in the solution explorer and clicking Add>New Project
From there select Setup Wizard, give it a name and click OK
A wizard will open, click Next
then select Create a setup for a Windows application
then click Next again. Select all of the groups you want to include, namely: Content Files, Source Files, Primary Output
Then click Finish
In the solution explorer you will see a bunch of buttons find the one that's tool tip says File System Editor and click it. You will see three folders in the file system editor, the only one we really care about is the Application Folder. That folder is where your projects build output should be.
To add files to it if they are not already there right click > Add > File...
Note: You cannot add entire folders (which sucks) and the folder structure in the Application Folder should be identical to that in your projects build.
You should create each folder and then add the files to it.
If you have multiple projects you should set the build directory to the same folder under the release build settings. To do this, open your solution, and for each project, right click/Properties go to the Compile tab, set it's configuration to Releaseand its Build output path to some folder (same for each project) (If you have an XNA project make sure its Content Build/Configuration is also set to Release).
Now select Release from the drop down menu on the tool bar (it most likely says Debug now)
Right click on your solution on the solution explorer and click Build Solution
Now all of your solutions built files will appear in the folder you chose in the compile tab. All of these files are what needs to be added to the Setup Projects Application Folder (in the same structure)
Customise the installer: click on the project name in the solution explorer and look through it's properties, change what you want (i.e Author, Manufacturer, Title - these make a difference to the installers output directory and text)
Build the installer project (same way as mentioned above) and you are done.
Feel free to comment with questions

Visual Studio "Clean & Rebuild" in one button?

My solution i'm working on it's has some specialy. And sometime I need to Clean solution and after that Rebuild solution, if not the web application can not access. That why I made a bat file for that work and bind the bat file to a button in Visual Studio toolbar.
But with that way, visual studio just run the bat file, so it clean and rebuild just one solution I'm defined before in the bat file. What I want is a button which can clean and rebuild on solution OPENING, is made a combo of Clean and Rebuild commands of visual studio to just one button.
Is there a way for me?
I'm using Visual Studio 2013.
As #Blorgbeard said,
What is Rebuild Solution?
Rebuild solution will clean and then build the solution from scratch, ignoring anything it’s done before. What it does is deletes all the assemblies, exe’s and referred files to compile again.
What is Clean Solution?
Clean Solution will delete all compiled files (i.e., EXE’s and DLL’s) from the bin/obj directory.
Rebuild means compile and link all source files regardless of whether they changed or not. Build is the normal thing to do and is faster. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean.

Resources