Visual Studio 2010 TFS Solution checked out and hard drive broken - visual-studio-2010

I am working on a group project in Visual Studio and using TFS for source control. I was working on the project from my laptop and the hard drive broke. Now the solution is eternally checked out by my laptop user. How can I clear the checkout from my laptop? None of the changes are needed, I have the log in credentials, and I can still get into Windows on the laptop (the secondary hard drive broke).

Easiest way to do this is using the tf.exe command line utility.
Find the exact workspace, if not already known, using:
tf workspaces /computer:computername
Then remove that workspace with:
tf workspaces /remove:workspacename
More info: http://msdn.microsoft.com/en-us/library/54dkh0y3.aspx

Related

Visual Studio: Syncing Projects with OneDrive and "Having the mark of the web"

I develop a few small projects in Visual Studio solo and for my needs using a repo like GitHub or Azure Repos just seems a little over the top. I therefore save my projects to OneDrive and develop my projects and when ready to publish and move onto the next build, just copy the existing project directory for version control and start work on to the next version.
However quite often I get stung when building projects
Couldn't process file <file>.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file. Remove the mark of the web if you want to process these files.
I then have to copy the director out of OneDrive to an unsynced area such as C:\Temp and it builds just fine but then has the issue of remembering to copy back my modified project once done. There seems to be no clear cause of it and the file properties does not have the usual 'Unblock' option:
Has anyone come across this with OneDrive, or any suggestions as to why it's happening? I'm sure the main suggestions would be use a repo solution but this method works just fine for me other than this issue so I'd ideally like to get a solution using OneDrive.
Edit: To confirm I've added my OneDrive path into the Visual Studio trusted locations area and tried adding file://[pc-name] into my local intranet trusted addresses area without any success.
My problem is IDENTICAL to yours. I have tried adding the pc to the safe sites list, I've tried adding to trusted location, I don't have the unblock checkbox that many people mention, I also tried using a powershell script to unblock the file. No luck. The only solution was to do a repair of Visual Studio. That fixed the issue for me so that it stopped happening.

Opening solution using Visual Studio 2017

I have been working on this little mobile app for android using Xamarin in Visual Studio 2017.
When opening the solution with the laptop that I used to develop the app works like a charm. Then I zip the entire folder over the solution.
../myFolder/
app1/ //here is all the code
app1.sln //solution file
myFolder.zip
Transfer the zip file to other laptop/PC through usb, email and online repository, even extensions like rar, 7zp and tar. I simply can not load the solution from other Visual Studio but the one where I created/developed the application originally.
Hours passing with this screen then VS is not responding and after that, it simply crashes/closes with no error message.
In the other hand, I can open any solution created from any other PC in my laptop without issues. After saving, I haven't found the pattern yet, but some solutions can't be opened from the original PC which creates them nor others.
You may be using an older version of Visual Studio on the PC you've facing the issue. I've faced that too.
It was a known bug (reported here and here) already fixed on newer versions.
The workaround is to close VS, delete the folder vs created in the same directory of your solution and try to reopen it.
To avoid other problems on compiling or running your app after that, I recommend you also to delete all bin and obj folders from your project's folders, clean and rebuild the solution.
It's safer keep all your development environments updated in software wise to avoid this kind of trouble.
I hope it helps.

Remove TFS mappings

I am using Visual Studio 2015. Initially I installed TFS 2013 on my local machine with source control mappings to my local User folder. After some time there was a need to include some more developers to my project so I installed TFS 2013 on a server running Windows Server 2012.
Then I UnBind my solution from local TFS and tried to add it to the TFS on the server. But it was only taking my local TFS, so I uninstalled TFS from my local machine. But then again when I tried to add my solution to the TFS on server, it gives the error shown in the image.
Then I removed my workspaces as mentioned in MSDN here
and here and then restarted my local machine but the error is still there.
Although I am creating the new workspace with exactly same name and place but when I have removed the older workspace and TFS from my local machine, wouldn't the error be removed!
May be TFS marked the workspaces somewhere in Computer registry but I don't know it. Kindly help me to solve this issue.
AWAIS is my local machine name
awais:8080/tfs was my older TFS that was on my local machine but I
already uninstalled it
You can use tf command-line to remove old workspace which clears cache as well:
tf workspaces /remove:* /collection:http://awais:8080/tfs/DefaultCollection
If it does not work, try removing from your connections on Team Explorer, deleting the local folder and clearing your cache
Use TFS Sidekicks to track the workspace, it is a great tool to manage the workspaces.

TFS in VS2010 "remembers" file system mappings for deleted server/workspace?

Using the TFS tools in VS2010, I had added a CodePlex server. I had mapped a project on there to a local path, say C:\MyProject Later, we moved the project to a dedicated TFS server, so I added a new TFS server, and deleted the CodePlex one. This in turn removed the "workspace" for it.
However, now if I try to map a project in the second TFS server to C:\MyProject, I get the error:
The path C:\MyProject is already mapped in workspace MY-MACHINE;SND\myCodeplexUserName [https://tfs.codeplex.com/tfs/tfs32]
If I go to File | Source Control | Workspaces... in VS, that CodePlex workspace is not listed (since I had deleted the TFS server reference)
Does anyone know of another way to remove the existing mappings?
Use the command line utility tf with the workspace and workspaces commands. You may also find the workfold command useful.
Open a Visual Studio Command Prompt and type:
tf help workspace
I had to do this the other day to delete all the workspaces for a collection that was moved to a different server. In my case, the command was tf workspace /delete /collection:<url>. Use tf workspaces to display all your current workspaces.

TFS - Checkout File from Outside Visual Studio - Offline Mode

i have used TF.exe (Team Foundation Client) to checkout files from outside with the following command.
http://blogs.msdn.com/b/noahc/archive/2007/01/22/real-tfs-command-line-help.aspx
tf checkout $project/filename
but, i need to checkout from outside when TFS server is also not reachable. In visual studio, it prompts us to work offline and then later on, it sync automatically with the changes into server when it goes online. How do i acheive the same from tf.exe or any other way to do it.
PS: i do have real requirement of editing some files which is not belongs solution files which gets modified from outside of visual studio. as of now,i am using tf checkout method to checkout the file from outside. but, this require connection TFS server all the time.
You can't do this with the command-line tools, because the offline mode is a feature of Visual Studio, not of TFS.
The tools always work directly with the TFS, so it must be online and reachable at that time.
Amendment regarding your P.S.: What Visual Studio does in Offline mode is just setting the local files to writable and "remembering" with which files it did that. Then, on going online again, it checks for any changes in the meantime. If there were any, it starts a merge process, if there weren't, it checks out the file without getting it.
There's no reason why you couldn't do this same process by hand, it's just more comfortable through VS.
BTW: Why not have a Solution for this "dangling files"? Just create an emtpy solution and add them as Solution Items. This way you can use the VS offline mode.

Resources