How to Get specific version of solution when there are multiple solution? - visual-studio-2012

I have multiple solutions in a folder. For example
C:\Code
-Solution1.sln
-Solution2.sln
-Solution3.sln
-[All other project files/folders belongs to above solution, etc]
Note that having these solutions in separate folders is not an option for me.
Assume if I open a one solution in VS2012 (i.e Solution1.sln). I right click on the solution
and select Source Control -> Get Specific Version...
Select Type "Latest Version", and tick two check boxes
a. Overwrite writable files that are not checked out
b. Overwrite all files even if the local version matches
And then press the "Get" button.
The problem is that this operation gets the all the latest files for the c:\Code folder - even the ones that are not belongs to my current opened solution (Solution1.sln). It replaces the files for Solution2 and Solution3.
Is there a way I can configure TFS only to get Solution1 file?
I'm using TFS2012
Update: Please see the sample structure below.

Okay. You have to move all your solution files to a solution folder will solve your problem. TFS is trying to get all the files from the solution folder and its sub folder. That's why you having this issue. Create a folder called Solution, you can create it inside the code folder or outside. Open your solution1 file in vs2012 and select the solution file and choose File -> Save Solution1.sln as and save it in the solutions directory. Repeat the same for all the solution files.
Once you are happy with the new solution files from the solutions directory, delete the old solutions files form the code directory.

Browse to your solution in Source Control Explorer, select "Get Specific Version" from the Advanced menu: it should work fine.

Related

Add unversioned file as new wersion in TortoiseSVN

I have the following problem.
I have a group of source code files.
I there has been some parallel development and testing, now I have different (unversioned) files with the same names. I need them to become a new version of the versioned codes (with keeping the history of previous changes).
Can you please tell me how to do it? I do not have much experience with SVN.
By some safe experimenting I found out that, if I have one file with code in my SVN folder and second file (named identically) with the new version of code. Simple copy and paste (neccessary to choose option "rewrite the file") solves the problem. After committing the file contains new version (can be checked with "Diff with previous version" functionality).
This procedure works as well for group of files or folders.

How to search only in currently open files in vscode?

I usually work on larger projects with many files that would contain the search query. So I would open the files I want to modify and do a find/replace across all currently opened files. Can this be done in vs code?
The feature I'm looking for is implemented in Notepad++, but I'd prefer not to have to switch editors for this task.
For me somehow it works just by typing ./ in the files to exclude field.
The ability to search only in the open editors is in the Stable Build v1.55.
As you can see, the icon is at the end of the files to include input so you will have to have that showing (click the three dots ... just below the search options if files to include is not already showing).
"Search: target particular set of files #20530" located here: https://github.com/Microsoft/vscode/issues/20530
Is tracking a search "scope" such as "all open files".
Hit Ctrl + Shift + F and enable the icon at the end of the 'file to include' text field
I don't think there's a way to do this. You can make a feature request on github. I think an extension could do it though.
There is a checkbox for this in the "files to include" field since version 1.55 (march 2021).
The answer was already mentioned (and accepted above) indeed typing ./ in the files to exclude box of the search window will allow you to only search in open files.
However the response mentioned that he was unsure why this worked. VSCode allows you to exclude all files in a directory by writing the directory in the exclude box. The directory . is the directory where VSCode is opened ie the root directory. The filter ./ excludes all files in the VSCodes root directory so all files are excluded. However opened files ignore any exclude filter. So if you exclude all files only the opened files will be searched.
The best way to find something you are searching for within a specific file in vs code would be:
Ctrl + p then pressing # on the search bar.
It will give you a list of all functions on the file, which makes it easier to track something down.
As an alternative to using Visual Studio Code itself, you can just search the file contents within the folder where unsaved files open in Visual Studio Code are located. This would be in one of these locations depending on which OS you are running:
Linux: /tmp/ (someone else running Linux can verify this)
macOS: ~/Library/Application\ Support/Code/Backups/
Windows: %APPDATA%\Code\User\
This extension is what I use for this purpose.
You may need to change the keybinding if there is a conflict.

Adding two existing projects of the same name but located in different folders

I have 2 projects that are structured somewhat like:
FolderA
|
\--> Project1.vcxproj
FolderB
|
\--> Project1.vcxproj
The two Project1s are actually different projects.
When I right-click on my solution and Add -> Existing Project, I get the following error.
The solution already contains an item named 'Project1'.
Given that I can't rename the actual project files and that I want them both added to the same solution, is there any way I could do it?
I've tried many things:
Renaming the project file in Visual Studio.
Deleting the .suo file and restarting VS.
Editing the .sln/.vcxproj files using a text editor (but there was nothing relevant that I could find).
All of the above resulted in the same error.
I would think that since the project files are in separate folders, VS would treat them as separate projects, but there must be something I'm overlooking.
The problem occurs when you have two project files with the same name (not projects with the same name, but project files). In your case they are Project1.vcxproj and Project1.vcxproj. Therefore, you have to rename one of them (and do not forget to rename the corresponding Project1.vcxproj.filters file) and only after this add this project to the solution as an existent project.
Maybe the problem can be solved somehow else, without renaming the files, but I do not know how.

How to view changes after "Get Latest Version"?

When I Get Latest Version I often want to see what files have changed (and the diff). How do I achieve this with the least amount of IDE navigation?
Best thing to do is a folder comparison before you get the latest version. In Source Control Explorer, you can compare the differences between two server folders, two local folders, or a server folder and a local folder. Right click on the target folder and select Compare. Read more here.
This is only a solution to part of your question "what files have changed".
Once you GetLatest, go to View -> output window or (CTRL + W,O). This will show you the list of files that was replaced in the last GetLatest operation. Once you have the list of files you can do file comparison on each file to get the changes.

Installshield : How to preserve files after uninstallation

I am using installshield 11 to create Basic MSI Project. My requirment is, when i unstall the project, i want to preserve certain files.( I don't want these Certain files to be removed when unstallation takes place ). Morover, these files are not a part of the component, but they are created(copied) during installation process by using copyfile (script) command from specific location.
-Dev
Use Disable(LOGGING)....Enable(LOGGING). Using CopyFile() in-between these methods will prevent uninstall removing the files
Windows installer removes only those files and folders which it installs. That is each file present in it's database in File table and Folder table. It do not remove any file which does not have entry in File table, similar for folder.
Also, If folder is not empty then that folder does not get deleted during uninstall.
If your installing some files using Copyfile script ( may be using any custom action) then those files will not be removed during uninstall.
Thanks Balachandra for your response, But i have below observation which might help.
Files which i want to preserve is created by CopyFile, and target dir which i mention in the copyfile command does not exist. So CopyFile creates the folder and copy the file to that folder. So obviosly we will not have this folder entry in the dir table of installsheild
But this approach does not help, uninstallation is removing all copied files from this folder.
-Dev
Thanks, Alerter, I've been fighting this one for 2 days.
We install an example configuration file and create a copy of it (on first installation). We needed to preserve the configuration file if the customer changed it, but the file was always getting deleted on uninstall. Disabling the LOGGING around the CopyFile command was exactly the solution for this situation.
Dev, I know this is an old post, but you should accept this as the correct answer.
Hopefully this phrase will help others find this solution easier through the search engines: Installshield file created with CopyFile is always deleted during uninstall

Resources