TFS checkin error VS2013 - The process cannot access the file - tfs

Consistently getting a checkin error via VS2013 for a MVC project. Have been spending quite some time but still dont get whats happening.
The project is cleaned. Checked that Application Experience is set to automatic. I am running on Windows 7
Any help ?

There is a file in your solution that does not exist on disk. Maybe it was deleted manually. If you know the file you can go looking for where it is referenced in your project hierarchy. It should be listed with a yellow triangle.
Either remove it or replace it.
If you don't have a local copy but it is still on the server you can find it in the Sourfe Explorer and do a Get Specific | Latest to recreate it.

Related

Website builds but publish to Azure fails after deleting files

Using Visual Studio 2019 to build a .Net Core website and publish to Azure was working fine up until I just deleted a DataContext file and an Entity class through Visual Studio. I can build and bring the site up locally without any issue but when I try to publish the site to Azure I get an error that the two files I deleted could not be found. I've checked in my code along with the solution file. The message is correct, those files are no longer available but I'm not understanding why it's looking for them since I deleted them through VS and the solution/project file should have been updated. I've done some searching but can't find anything that specifically address this. I guess I could roll back to right before I deleted the files but then I'l have to update some code. Anyone know if I can look somewhere that is referencing these files for publishing so I can delete the reference? I've searched the whole solution for the name of the files hoping I could find a reference but it isn't finding anything.

Can't check in changes to TFS

I am having issues trying to check in changes to TFS hosted on Visual Studio Online. Started just last week. I am running Visual Studio Professional 2017 version 15.5.2.
When I try to check in changes, I get this error:
C:\My\Workspace\Path\Project\File.cs: Download of item $/Workspace/Path/Project/file.cs was not completed. Perform a get operation to correct.
Okay, whatever. Sounds simple enough.
So I go to the problem file and do a Get Latest Version.
When I do that, I then get this error:
Source Control Explorer
The network path was not found.
The output in the Output window after attempting the get is this:
Conflict C:\...\...\...\...\...\Program.cs - Unable to perform the get operation because you have a conflicting edit
Automatically resolved conflict: edit: C:\...\...\...\...\...\Program.cs as TakeTheirs
The network path was not found.
I have read a number of posts, and tried a number of things. None have fixed the issue. Things I have tried...
Delete the TFS cached under AppData. Did nothing to help.
Disconnect VS from the TFS project, then delete the hidden $tf folder under my local workspace and then reconnect VS to the team project and re-get everything. The initial re-gets all worked. But once I made some changes to a project and then tried to check it in, it started with these errors again.
Anyone have any other ideas? The next step I see in my future is having to uninstall and reinstall visual studio, but I'm REALLY trying to avoid that.
So, the solution is Deleteing and recreating the workspace.
You will meet similar issues when a workspace is messed up.
Generally, you can try below item to fix such an issue:
Disconnect any instance, close VS, then delete the cache folder located at: e.g. %localappdata%\Microsoft\Team Foundation\7.0\Cache, then restart the VS, connect to TFS/VSTS again.
Remap the workspace to a new folder
Delete the old workspace and create a new one, map it.
By the by, ... I had this issue again today, and had a slightly different fix. When I went to delete my workspace, I found that a prior aborted new project had somehow added additional working folder mappings to my workspace. So I deleted those, after which VS said it needed to restart. So I let it, and now everything seems to be working fine.
Just figured I'd let people know, in case they find that situation, so they needn't go through with the whole other drastic measures, to check this first and try it if it applies.

Why is TFS not updating my project?

We have an ASP.Net MVC Core project solution in TFS.
And there is an error icon at the top of the solution explorer that says "Package restore failed".
And if I open up the project.json I see the red sqigglies:
"The dependency ... could not be resolved" for several dependencies.
The developer who created this error has since fixed it. And all the other developers on the team get latest and the error goes away.
But it won't go away for me.
I get latest and the error icon at the top of the solution explorer and the errors within the project.json are still there.
I blew away the folder, got latest from Team Explorer, and the errors are still there while gone for the other errors.
Anyone know why this is happening?
I'm stumped. I don't understand what is happening.
First, you could try to do a force update for the specific error fixed changeset.
To force a update, use the "Get Specific Version" command with the
"Overwrite all... " option checked.
You could also clear TFS and VS cache, delete old workspace(back up changes first), create a new one, then do a fresh getting latest files from TFS source control. Which should do the trick.
If the issue still exist, you will have to check your local environment if you are missing some thing. Do a simply compare of the environment with other developers on the team.
It turns out this was a combination of the way .Net Core stores nugget packages and of being in a government environment.
We log into our computer with one account that does not have admin priveledges and this is the one I develop with in order to connect to TFS. But there seems to be a lock on the users folder for this account. So when I start up the solution and project.json tries to resolve all the packages, if one is missing it can't download it and put it in that folder. I then have to start Visual Studio as an Admin and open the project. Then the missing package is downloaded to the nugget package folder under my Admin user's folder. Then I read the resolution failure output at the top of the solution explorer next the the red circle with the X in it to see which package is missing and copy it over. It may be more than one so you have to close VS open back up as the non admin account and look for the next one that fails.

Visual Studio 2013, TFS is very slow

When I originally installed VS Ultimate 2013 everything was fine but for the last month or so it's been a dog.
The source control explore in my Visual Studio 2013 install is very slow. Just clicking on a node and the act of displaying the node contents takes 20+ seconds.
Everyone else on the team is ok so it's not the TFS server it's just my install.
I assumed it was some addin I'd installed into VS so disabled them but no luck.
Any ideas?
Having tried all suggestions, unloaded all add ons, tried to reinstall VS, removed all extra workspaces etc. the answer to my problem was to unmap my workspace and then remap it.
Problem solved. Not got a clue what the underlying fault was.
In my case, the only way to get rid of the lag was to change my workspace location from "local" to server. You can do this under the advanced options for your workspace.
The 'full blast' solution that worked for me was;
remove workspace
delete all source code
rebuild the workspace
rebuild solution
Only takes a few minutes more than just rebuilding the workspace (see #DaveF's answer) but gave me a bit more confidence that everything hangs together.
Had this happen to me a few times now, so there are some things I'd like to add to the accepted answer.
I work in a place where we have a lot of VS solutions with a lot of files in them. Microsoft's guidelines suggest that you shouldn't be using a local workspace if its going to have more than 100,000 items in it. So you could prevent this problem entirely by:
Not using local workspaces
Making sure never to map enough folders into a single workspace that it gets over 100,000 files associated with it.
Periodically declaring "TFS bankruptcy" and unmapping everything.
For me, the drawback of having to use strict locking and not having offline access makes #1 unacceptable. I'm going to try harder to do #2, but honestly #3 is what I've been living by.
Its kind of like early Windows, where every year or so you had to just reinstall the OS to remove all the accumulated cruft.
Cleaning local folders helped: See 'Team Explorer - Pending Changes', under 'Excluded Changes' it said: 'Detected: 50000 add(s)'. Click it to see path to folders.
This make me crazy too for over six months until I found this instruction. Now, my VSO is fling. Note: this information I copy from somebody. Would like to give them credit but I cannot remember how did I find this.
You can fix this problem of TFS by editing registry.
Navigate to key
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\TeamFoundation\SourceControl\Proxy
and then change value of URL to any dummy website like 'www.abcdummy.com'
Restart VS after editing registry key value.
I had the same problem, it kept me busy for a week or so, but after investigating my complete setup i found the following:
Within my ASP.NET application, i had an image directory and an image cache directory, with lots of images in them. (+200.000). Both were not included in my VS project, but still Visual Studio / TFS tripped over this.
First i found, that when checking in some files (which took over 10 minutes when the problem existed), in 'Team Explorer - Pending Changes', under 'Excluded Changes' it said: 'Detected: 50000 add(s)'.
Trying to get rid of this the 'normal way', by opening that 'Promote Candidate Changes' window and setting these files to be ignored, still didn't do much.
But after moving those image directories to some other location, outside my project, all problems disappeared.
Of course i had to add those moved directories as virtual directories to still see my images.
I cleaned my workspace of unnecessary projects and it ran better. I think vh_click is on to something with the 50,000 ads thing. TFS keeps track of all your edits and over time with tons of projects, undos, and craziness you could amasse a large set of which TFS has to chug. Get out the Clorox, the Comet or whatever else you clean with and dump some junk or move it to some archive folder or backup drive.
Cleaning up the Workspace was the solution for me, when opening visual studio 2015 the Source Control Window will remain in a Loading phase, I had 2 workspaces name and name_1 and I removed both.
No need to delete the entire folder, though , keep in mind that if you do delete the workspace and have the files, you will need to force the get latest to be on the safe side
Getting Latest was soooooo slow. I was using a Colleagues PC and had deleted his Workspace.
After an hour waiting to get latest I got an error and realised my User Account didn't have Full Control on the folder, giving Write Access made Get Latest run x1000 faster:
Just to throw another solution in the mix! I had the same problem which seemed to be caused by several layers of working folders configured in my workspace (some overlapping ones too).
The issue was resolved by going to Manage Workspaces, then Edit and then removing the additional folder bindings.
in short "Run it as an administrator".
No one of those solution does work at all, I even search on this link:
Why is Visual Studio 2013 very slow?
In vain, just do this ONE simple step:
Go to your visual studio path, usually installed on this path:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE namely the file "devenv.exe" , then right click on it, click "Run an administrator" ===> then open your visual studio project.
So, you can just send a shortcut of "devenv.exe" to the desktop to easily run it as an administrator each time.
Have ^_^ Fun
You can keep workspace on local and change your workspace to this. I did that and my TFS speed was great :
1- Remove all mapped folders in workspace "Edit":
2- Change workspace folder to parent all of mapped folders:
I hope it is useful for you.

Nuget.targets not found on first time solution opening

When I open a solution for the first time after it has been downloaded from TFS, it (Vs2010) is unable to find the NuGet.targets file.
I've checked TFS and it's marked as downloaded, and it exists on the file system.
If I try to open the solution directly from TFS again, it suddenly works.
I feel this is the reason why my automated builds are also failing.
Has anyone come across this issue before?
Ran into this Friday and on another machine today.
For the machine on Friday I copied the .nuget directory, since I didn't have one.
For the machine today it had the .nuget directory and copying it from another machine didn't resolve the issue. Opening it from TFS's Source Control Explorer didn't work either.
We then followed the steps on Opening project in Visual Studio fails due to nuget.targets not found error (enable Package Restore on the solution) and it worked without issue.
Hadn't run into this before last week, and it's just one project of many, with none of the others having this problem.
When Visual Studio downloads solutions from TFS (double click sln file in solution explorer) it appears to download files one by one and load them up. Unfortunately it seems to try opening project files before it downloads the .nuget directory, which is why it can't find the file. The last thing it appears to do is download that file, which explains why it is on disk but gave the error. If you reopen the solution it's already there and works fine.
When TFS Build server downloads a solution to build, it does so on the solution directory instead. Which means it will get the .nuget directory before it tries to build so it shouldn't cause issues on the build server.
I believe this is a bug in Visual Studio, it really should download all the solution items first. Although it would be nice if it had the same behaviour as TFS Builds.
A work around for this issue is to get latest on the solution folder before you open the solution for the first time. Not ideal but it works.
I'd also suggest logging a bug with either the nuget or visual studio team, however I suspect they're probably already aware of it.
I had this problem trying to run through the tutorial at http://www.windowsazure.com/en-us/develop/net/tutorials/multi-tier-web-site/2-download-and-run/
Turns out the zip file the source code was in extracts into a folder containing commas, which I don't think msbuild liked. Moving it into a more safely named directory helped.
Try these steps
Install Nuget.
Right click on the solution and select "Enable NuGet Package
Restore".
Click Ok on the warning.
Close and re-open the solution.

Resources