I don't see an option to tell VC++ what the current project is, so that I can search within a specific project within my solution, rather than the whole solution.
Is it something that happens as a side-effect of some other operation or can I somehow explicitly select which project is the current one?
currently opened file on which you opened the Find/Replace dialog belongs to a certain project. So that project is basically the "Current Project"
Right click on a project in the Solution Explorer and select 'Set as Startup Project.' The 'Startup' project is the "current" project.
This question has a longer answer that it would seem. To make the Current Project selection, go to Solution Explorer and click on the desired project so that it is highlighted. It is not necessary to make the project your StartUp Project, but doing so will highlight the project as required to make it the Current Project for the search. You can make the project selection before or after opening the find/replace dialog. If you do not have a project selected (by selecting the solution), there is no current project and nothing gets searched.
However, there is at least one alternative. If the Property Manager is opened, a selection there will also set the current project. If both are opened, it appears that the last selection becomes the current project. This information is for VS2017, but probably it has been that way for many older versions since the Current Project search option has been around for a long time.
Related
As per the tags, I'm using VS2013 and TFS2013.
There are multiple projects in the solution: Model, Presenter, View, etc. All other projects are working as expected in terms of source control operations.
Problems with the Model project:
Adding a new file via Solution Explorer isn't automatically detected as a pending change
Deleting a file isn't detected either
Other source control operations work fine for the Model project, such as:
Get latest version
Edit detection for existing files (including changes to the csproj
file when a new file is added)
Checking in pending changes
The csproj file would show up in pending changes with the newly added file listed in it, but the new file itself isn't showing up, therefore causing build errors on other developers' machines if only the csproj changes are checked in.
The workaround is to find the added file in solution explorer and Add via context menu, this will make it appear as a pending change. But this process should be automatic as per the other projects.
Noticed that there is no .vspscc file for the Model project while other projects have one each.
Any help appreciated. Thanks.
I would unbind and rebind the problem project and try again:
To unbind a solution or project from source control
In Visual Studio, open Solution Explorer and select a solution or
project to unbind.
On the File menu, click Source Control, then Change Source Control.
In the Change Source Control dialog box, click Unbind.
To bind a solution or project to source control
In Visual Studio, open Solution Explorer and select a solution or project to bind.
On the File menu, click Source Control, then Change Source Control.
In the Change Source Control dialog box, click Bind.
Select the database and location to which to bind, and click OK.
Click OK.
You might need to go to Advanced to find the Change Source Control option
https://msdn.microsoft.com/en-us/library/0eh3790h%28v=vs.90%29.aspx
Before unbinding and binding your solution try his:
Go to Source Control Explorer
Click the "Add Items to Folder" (the
one on the left of the red cross)
Select the items you want to Add and follow the instructions on screen
That's all
Click <Detected: x add(s), x delete(s)> : in the source control explorer then select the file to add
For years I've been relying on 'Detected Adds' to add missing files - which was never a sustainable solution but I've just about managed with it.
But now if broke.
I'm actually about to reinstall Windows but in the meantime one of the best ways I've found to get a sense on what's missing (and it's still working even though the detected adds isn't) is the recursive 'Compare' window.
You can add files from here too.
It's a little klunky but it gives me a good sense of security and shows file diffs if you want to see what may have changes.
One would think that adding a project to a Workspace in Xcode would be intuitive.
1) But when you add a new project it is added within the existing project - It must be a bug, or is there actually a reason.
2) How do you add a project then (ctr + right click et.)
You could use the plus (+) button on the lower left corner of Xcode IDE to add a new project to a workspace. You must have first a blank workspace, which you could use the menu (New/Workspaces with short cuts ^%N).
To morning I spend some time doing what you asked to. so here are the steps (you can skip if you already have followed some).
Create a new blank work space
Add a project to it by clicking File->Add new files to "Your workSpace" or "command+option+A"
Choose your project folder Or yourproject.xcodeproj file
Just let the indexing finish properly, and congratulations you have added a new project to your xcode work space successfully.
Note: Make sure that project which you are adding is not already opened, Xcode get lil sensitive about that and doesn't show files tree in workspace in that case.
My answer pertains to XCode 5, but should pertain to XCode 4 as well.
In typical Apple fashion, they have given you multiple ways to do the almost the same thing. Very confusing and annoying. There are three ways, and only one way pertains to the original posters question:
(1) Use File --> Add Files to ...
Problem with this, is that it will only add files to workspace if NO project has been selected.
Problem with THAT, is that once you select a project, there is no way I know of to unselect it.
(2) Use the "+" in the lower-left corner.
Problem with that, it is equivalent to using the pull down menu (#1 above)
(3) Right click in the left pane (in an empty area), and you will see "Add files to "
This is the only right way to do it, as it guarantees that the file will be added to the workspace, and not any selected project.
Try all three methods after selecting an existing project, and you will see what I mean.
Based on my previous experience with XCode, Apple will take about 10 more years to fix this sort of thing.
One would think that adding a project to a Workspace in Xcode would be
intuitive.
Of course not, this is Apple, only usable for certain experts...
1) But when you add a new project it is added within the existing project -
It must be a bug, or is there actually a reason
You did miss the drop down selection list "Add to:" in the last of three dialog pages, the place where the location of the .xcodeproj file is specified. There you can select the Workspace you are currently using. So simply use "File" "New..." "Project...", give it a name and select from templates, and NEVER intuitiveley double click on the directory where to place the project file, but be sure to adjust the selection drop down list to your currently open workspace. Of course this choice is never preselected.
I'm working on an IronPython project on VS2010 and I've notice that for the python project (which is setup as a Console project, but really just contains a number of scripts that are hosted in a C# app), everything that is in the project directory will show up in the VS solution explorer under that project. So, for example, the .svn folder shows up. Which I obviously don't want or need to be there.
Is there any way to tell it to hide specific items? I sure can't find one.
Currently we have a directory based project system - which as you have seen includes all of the files in the project dir. We were planning on having an exclude option but the feedback we've been hearing so far is that we should move to a normal VS project model where you need to explicitly add the files. The next CTP release (which should be out in a week or so) will change to a normal project model.
There does still seem to be some interest in the directory based model so we may bring it back via an option in a future version.
You should be able to just right click the folder, choose "Exclude from Project"
Then, make sure "Show all files" is NOT on at the top, by the solution.
I added a project to an existing solution that is currently under source control using TFS, but for some reason I cannot check in the new project. When I view my pending changes, none of the files in the new project show up. None of the files have a plus (for a new file) next to them. What did I do wrong? How do I fix it? It's time to check in.
The problem is the solution has lost its binding. That's why it's not checking out automatically when you add the new project.
In order to restore the binding in VS 2010, go to File->Source Control->Change Source Control. Look for the "Solution: your solution name" and if it's not bound it will say "no server". Click on it and then click "Bind" from the toolbar.
in Visual Studio 2012/2013 it's File->Source Control->Advanced->Change Source Control (Thanks to danglund).
This should create a new vssscc file that is correctly bound. Now add the new project and everything should work correctly.
I was also having the same problem, this is how I fixed it:
Go to Visual Studion: File->Source Control->Change Source Control
Find your project there, its status would be "Invalid", Click on it and press "Unbind". Now go back to Solution Explorer and Remove your project. Add this project again into the solution explorer solve the problem.
Good Luck!
Click on the Team Project name in Source Control Explorer
File -> Source Control -> Add Items to Folder...
Follow the wizard.
Head over to Source Control Explorer and browse to the place in the tree which matches where the new project is at for your solution. Add the files there.
However, I'd be concerned that you modified the solution file and it didn't ask you to check that out. What you may want to try doing is manually checking out the solution file, then readding the project to the solution and seeing if it takes then.
You shouldn't need to drop to the command line - this is a pretty straightforward operation.
Open the solution. Select the project (make sure it is in the solution).
File -> Source Control -> Properties will bring up the binding dialog.
Bind the project to source control.
You should now see + signs next to all your files. The key is that that a .vssscc is added for your project to version control.
If that fails, open your csproj in notepad (after making a backup), and ensure any version control bindings are removed, then try again.
Unfortunately, I'd wager that your best bet is to manually do the check-ins through the command line. I've ran into situations where the Team Explorer UI grows out of sync with what's actually happening in source control, and manually fixing things through tf.exe was the only way to resolve it.
That said, normally, adding a new project to a solution isn't a hassle.
TFS can simply do not know about your project existed. Just add your project files through Source Control Explorer and re-load the solution.
While loading of a solution it can ask you to bind your project to source control. Let it do so by clicking Bind button - it should do all the magic for you.
Make sure you get the latest version of the solution
Check out the solution file
Add the new project
If the newly added project was previously under (another) source control, that might mess things up, make sure to "unbind" it before adding it. (See source control bindings somewhere under the "file" menu in Visual Studio)
You shouldn't need the command line.
I had this same problem in VS 2019, where I had added a new project to an existing solution, and the project wasn't showing up in pending changes. Right-clicking on the project and going to Source Control only had an option to "Add Solution to Source Control".
Using the above answers, I started down the File --> Source Control path, which then yielded an option to directly "Add selected projects to source control". Taking that option solved the problem, so that now the new project shows up in pending changes. NOTE: I'm adding this answer since it's still an issue in VS 2019, but has an easier solution now than in the past.
I have a VB6 project in Visual Source Safe 6.0. When I open the project I want to Check Out (Get) all the files in the project so that I can edit them.
I have the VSS Options (within VB6) set to act on the Project recursively, but when I check out the project.vbp it only checks out the project file, not all the modules, etc. Those files all remain write protected until I individually check out each one.
SOLUTION: Select the Project.vbp and, from the Tool>SourceSafe menu choose Check Out, you get a dialog which lets you choose ALL files (you get a checkbox for each and a button for Select All).
Why I had problems
For some reason, if you right-click on the Project in the Project tree and choose Check Out it doesn't give you that dialog. It just checks out the Project file. (However, if you do the same thing and Check In, it gives you the dialog with the checkboxes for each file. I guess that that point it knows that you have more than one file to check in.
FWIW generally speaking you get more options when choosing 'Check out...' via the Tools menu as compared with choosing 'Check out' from the right click context menu. One of the more useful 'Advanced' options is to check out with out 'getting' (i.e. replacing) your local file.