How to temporarily exclude files from being built - visual-studio-2010

My project files are controlled by Perforce and I have installed the SCC plugin so that I can work directly with Perforce inside Visual Studio 2010.
Here is the problem I have:
Inside the project, there are several files that I don't want to take into consideration while I build the project. If I use the context menu "Exclude from Project", I saw the following warning message:
Checked out items cannot be deleted by your source control provider.
If you continue with the change, you may need to manually delete
xxx.‌h in the source control database.
Is there a workaround that I can use?
Thank you

If you simply do not want them to compile, select the code file and look at the Properties window. Set Build Action to content or some other non-compile setting.

Related

Add existing files to visual studio project

I have a straightorward console application that I build using code::blocks. A client has requested a microsoft visual studio project to build it. So I downloaded and installed visual studio and created a project. Now I am trying to add my source files to the project.
Various online help pages say "Select project; select menu item "Add Existing Item" ( e.g. https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/9f4t9t92(v=vs.100). I cannot find "add existing item"! Add new item simply adds an empty file.
I tried dragging files from windows explorer onto the project, but this REMOVES the file from where it belongs - NOT what I want to happen.
Surely there must be a way to do this! Even without using alternative IDEs, different projects frequently must share common source code, so source files from one project need to be added to another.
The answer is to use File | New | Project from Existing code rather than simple 'New Project' when creating the project

Compiled JavaScript Files Not Appearing In Visual Studio Project

I'm using TypeScript 0.9.5 and when I add a TypeScript file, I no longer see the compiled JavaScript file or the generated source maps in Visual Studio solution explorer.
Where have my JavaScript files gone?
Because the generated files are like binaries, they shouldn't really be part of your project or be added to source control.
In previous versions of TypeScript, having the files in the project / under source control could cause issues on build servers in cases where the build server was averse to changing files that are under source control.
Another problem caused by having the files in the project / under source control is that even if you don't change your TypeScript file, the generated files are re-created on build and are picked up by source control clients as being changes. These would all show as revisions if you checked them in (or you'd have to manually exclude the changes to avoid polluting your source control repository).
The new treatment of the generated files makes them more like your .NET DLLs - they get generated on the build server (and locally on your disk) but you don't need them in source-control.
click on show more in solution Explorer as shown in picture
click here to see image..

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"?

Getting Team Foundation to recognize new files added to source controlled directory

I am working on a PHP project, so I am not using Visual Studio, however the company I work at is mostly a .NET shop so we use Team Foundation Server for version control. I can use VS to manually add files to the TFS project but that is a bit cumbersome when I am adding a bunch of new files, I pretty much have to add the file right after I create it so I don't forget.
What I want to know is if there is a way to have TFS pick up a new file added to a directory that is under source control for a project. For instance if I added a few PHP files to the source controlled html directory I would like to be able to just go to check in pending changes in TFS and have the newly added files included in the list. Does anyone know if this is possible? Thanks much!
There's no way to have this happen automatically with TFS 2010 or below. I've seen a video that says they'll be adding this feature for the next release.
In the meantime, you can use Source Control Explorer, then right-click a folder in the left pane and choose "Add Items to Folder". Follow the dialog and you'll be able to add any of the items that haven't previously been added.

Why is TFS ignoring a project in my solution?

I have multiple projects in our solution that is in our TFS 2010 repository. I've added about 5 new projects to this solution in recent days.
I have found that for one of the projects, that the project file itself will not check-in to TFS. All of the artifacts contained in this project are working fine; they are checked in and I can see them in the Team Explorer. But I cannot see the project file in Team Explorer, nor is their an icon next to the project in Solution Explorer that would indicate its checked in status.
Also, clicking on any of the TFS related option in the context menu in Visual Studio results in those options being applied to the file contained in the project, not the actual project itself.
Can this be remedied or do I have to create an entirely new project and add all of the artifacts from the old project back into it?
Your project doesn't have appropriate Source Control Bindings! With the solution open, you'll need to go to File -> Source Control -> Change Source Control to view the bindings for your projects. The failing one probably will show an "Unknown" or not binded status. You can then use that dialog to correct the binding and check in the project file.
Appended Alternate Solution -
Navigate to the Team Explorer -> Source Control and manually add the files using the "Add Items to Folder" menu item.
You can try following steps
1 Unbind the project in "Change Source Control" dialog
2 Refresh project to update source control status
3 Right click the project and click Add the Project to source Control in solution explorer
I was faced with the same issue but the solution is slightly different than those mentioned so far. My project's contents were checked in but the project itself was not. The project's bindings were valid.
In the Team explorer's Source Code Explorer, the project files were greyed out. After a get-latest, TFS opened the Merge Conflicts screen where I could choose to keep the local copy.
After this, the project was part of TFS.

Resources