Adding projects to new PC and TFS issues - visual-studio-2010

I have received a new laptop. I have copied all of my source over from my old laptop to my new laptop.
On my new laptop, running VS2010, I did the the following to change the bindings and workspaces:
To change the workspaces:
File > Source Control > Workspaces > Select My workspace in List > changed folder paths.
To bind my source:
File > Source Control > Change Source Control > Change Source Control.
Now the problem is when I try to check out my solution for edit, I get the following error:
The item could not be found in your workspace, or you do not have permission to access it.
I see some of the files are missing, but why would this be?
How can I solve this?

It would be better to create a new workspace on your new laptop.

Related

Moving a Visual Studio project from a different computer?

I am using Visual Studio 2019, and I am trying to open a project sent by my friend. However, when I tried opening the solution or the project, this error shows up:
An error occurred in '[Unknown]' while attempting to open <filename>
File path: (The path from my friend's computer)
Frame GUID:
Frame mode:
Error code: 0x80004005
I have tried to change the file path, but the file path is correct in my computer, so what is this file path referencing to ?
Close the solution, then delete the folder named .vs (note the dot) in the project directory and restart Visual Studio. This folder contains cached data that's computer-dependent.
You can also just close the window with the error and reopen the file from the solution explorer.

How Disable Locked Files in 8.1 without encryption key

I delete my unity project which has a .git folder and ask me to create an encryption key I don't know why it asks me to do that, now when I try to add files in git it refuses to add any things and it prompts this error
The file will have its original line endings in your working directory
error: open("Temp/UnityLockfile"): Permission denied
error: unable to index file 'Temp/UnityLockfile'
fatal: adding files failed
Any suggestion
In general the Temp folder is one of the things you do NOT want to be under version control! It should be ignored as mentioned by the first comment! Use this .gitignore file in the root folder of your git project!
Also see Cleaning up and Migrating existing Unity project into new one or another PC where I explained it a bit more in detail and also how to copy your project with only the necessary files.
As said if there is no such file yet simply create it, otherwise adopt the content accordingly.
Also refer to How can I make Git "forget" about a file that was tracked, but is now in .gitignore?.
In your specific case here the error itself is caused because you currently have your project opened in Unity.
In that case there is the - as the name says - LOCK file which ensures you cannot open the same project twice in a second Unity instance.
This file is locked/owned by the Unity Editor process itself and therefore can't be overwritten/accessed by git at the same time.
Now if for some reason after adding the .gitignore file mentioned above this issue still persists you can close Unity, manually delete the Temp folder, make your git merge and reopen Unity.

Finding files that are not checked into repo

Is there an easy way to find files that are not checked into my repository in my Visual Studio project?
In the past, there's been times when I get my code base from the repo only to realize that some files -- for some reason -- had not been checked into the repository.
I recently got a new laptop and downloaded the code for my app onto my new machine. I'm now getting an error when I run the app on the new laptop but on the old one it runs perfectly fine. My first thought was that there were configuration differences between two machines so I downloaded the code into a new folder on the old machine and started having the same error that I'm having on the new laptop. If I run the app from the original folder on the old machine, it runs fine.
This makes me think that I may have some differences in the code between what's on the repo and the original folder. As a result, if I get the code from the repo, I have the error. If I try to check in the code from the original folder on the old laptop, Visual Studio tells me that there's nothing to check in.
So, is there an easy way for me to see if there's any file that is not checked into the repo on my old laptop?
BTW, I'm running Visual Studio 2019 -- with the latest updates/patches -- and my repo is on Azure DevOps and uses TFVC.
Running tf vc status /format:detailed /recursive from a Visual Studio Developer Commandline in your workspace root should give you a good overview of files not checked in and files with pending changes.
C:\Users\JesseHouwing\source\Workspaces\xxx>tf vc status /format:detailed /recursive
-----------------------------------------------------------------------------------------------------------------------
Detected Changes:
-----------------------------------------------------------------------------------------------------------------------
$/xxx/test.txt
User : Jesse Houwing
Date : zaterdag 27 juli 2019 21:20:00
Lock : none
Change : add
Workspace : SHARKIE
Local item : [SHARKIE] C:\Users\JesseHouwing\Source\Workspaces\xxx\test.txt
0 change(s), 1 detected change(s)
It should auto-detect files unless you specify the /nodetectchanges flag.
Or, if your .tfignore file is well specified, you can run tf vc add * /recursive to automatically create a pending change for all files that are currently not under version control. If needed, edit your tfignore file before running the add command. Add /noignore to bypass the ignore file, but that may add bin and obj and packages folders as well, be careful.
tf.exe is hidden deep in the bowels of Visual Studio, easiest way to get access to it is to use the Developer Command Prompt:
My installation has put it here:
C:\Users\JesseHouwing\source\Workspaces\xxx>where tf
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe

TFS Build Error Path already mapped to another workspace Occuring even after deleting cache file

Firstly I read through many existing threads and followed the instructions there
Here
Here
Here
Here
Here
Here
Almost all the above threads asked me to delete the cache file. I went into the machine and deleted the cache file. I even edited the cache file (XML file named version config) but still it gets overwritten
But still even after that I am seeing the same issue.
The build agent has got dynamic $SourceDir as value
What else can I do to fix this? Please Help.
I tried doing tf workspaces but it simply keeps saying that "Unable to determine the source control server"
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets (838): Unable to create the workspace 'NVM1756PDV_105_7' due to a mapping conflict. You may need to manually delete an old workspace. You can get a list of workspaces on a computer with the command 'tf workspaces /computer:%COMPUTERNAME%'.
Details: The path C:\Builds\7\Common_Security\cloud\src is already mapped in workspace NVM1756PDV_104_7.
Run the tf workspace /delete NVM1756PDV_104_7 command to correct this error.
Try using TFS Sidekicks to delete the workspace using the Workspace Sidekick.

VS 2010 - Import Export Settings

Everytime I open VS 2010 I get this:
The automatically saved settings file 'visual studio 2010\settings\CurrentSettings.vssettings' is not available for write. You can change this file on the 'Import and Export Settings' Tools Options page.
Great ok. I'll export what i've got out and move it to a new location, and then set that as the location to look for the settings file.
Step 1: Fail
Import and Export Settings Wizard > Export selected environment settings > next > next > Dialog dissappears with no information on any file being stored anywhere.
Step 2: Fail
Manually find old CurrentSettings.vssettings file. Copy to new location e.g. C:\VSSettings\CurrentSettings.vssettings
Tools > Options > Environment > Import and Export Settings > Automatically save my settings to this file:
Change location to C:\VSSettings\CurrentSettings.vssettings
The specified path for the auto-save settings file is invalid. Please enter a valid path.
Clicking on the browse button does nothing. Something has screwed up here, obviously because it couldn't get to the location where my settings WERE being stored.
Step 3: ?
How to fix this up
I would prefer to not have to reset my settings because it IS loading some of them from soemwhere.
This command will reset the settings if you're having trouble with the GUI. This will work going back to at least 2005--as long as you change the path accordingly, of course :)
"%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /resetuserdata
Also see: http://blogs.msdn.com/b/astebner/archive/2005/11/22/496098.aspx
This worked for me: (in VS 2013)
1. Go to Tools > Options
2. Go to Environment > "Import and Export Settings"
3. Change the path to existing one
Source blog.icsharp.net
I had to reset settings.
Happened because a mapped drive didn't map and corrupted the Import and Export Settings Wizard.
It is working Perfectly
1.Click Start and run or type "run" in search box of Start menu
2.Then double click the run and you should type cmd and open command prompt.
3.Then copy and paste the below command in command prompt -> Click Enter .
%programfiles%\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" /resetuserdata

Resources