TFS Check-in oddity causes file to become a different file entirely - visual-studio

I'm trying to figure out the root cause of a strange TFS error we are seeing in our current instance. It wasn't noticed until after a server move, but I'm not sure if they're directly related, because the error seems to be showing up for check-ins about a week prior to the move, as well as all those following it.
We first noticed the problem when I tried to get latest, and got several errors indicating:
"The downloaded file is corrupt. Please get the file again."
Upon looking into the error, we have noticed that starting as of a single check-in every code update has resulted in files being replaced with the contents of other files, ranging from project files to binary executable files (presumably assembly DLLs), rather than the expected content which is still present on our local development machines.
I don't have admin access to the servers myself, but am looking for ideas on possible causes and/or fixes for our team to investigate.

After weeks of searching, I finally found another mention of this sort of thing happening, along with a solution that appears to have worked.
Clear the Application Tier cache.
MSDN Archived Forums: TFS swapping contents of files

Related

I have a bunch of files in my stage area which is causing issues and I don't know how to remove them

I was working on a static website and decided to change my account as I recently changed my Github username. When I say account, I mean the icon in the bottom left corner of VS Code. In doing so, 10k files were added, and all my extensions disappeared.
The staged files include App Data files that I can't clear.
My Discord is affected. I can't open it as when I do, a message comes up and says:
'update.exe' has been moved or changed. Would you like to delete the shortcut?
Although it's an issue, I essentially have to reinstall it, but the same issue may still arise, which it has as I've tried reinstalling it.
My concern is I feel I may affect other programs by trying to come up with a solution.
I'm posting this question to get help on removing the 10k files that are staged and do not affect program files/app data. When I try to commit these files, I get an error saying,
Git Fatal :pathsepc C\Users.....\getconfig did not match any files
I would think all I need to do is add these files to a gitignore file, but I would need steps if so.
I hope I've explained my problem clearly to get a solution.
Please help.
Staged files

Errors on build in a file that doesn't exists anymore/was renamed

I have a few t4 templates in my solution and at some point I renamed the the files and made some changes to them. When I did a build I got the above errors. Interestingly enough when I click on the file names nothing happens and when I hover over them to get the full name I notice that it's referencing the file name that I changed earlier. Also I've gone to all the files it could possibly be referencing and made sure that this error is not occurring in any of them.
I've tried cleaning and rebuilding, ensuring that all the projects are configured to build in the configuration manager. I deleted the file that I renamed and recreated it and the errors were still present even while the file was delete. Also I tried creating a file with the exact same name as the one referenced in the error message and it actually let me create the file, indicating that vs clearly knows that there is not file with that name so it seems to be a problem specifically with the debugger maybe?
I suspect this could be some strange behaviour with t4 templates as I feel like something like this happened before. A full restart of my machine was what solved that last time but it didn't work this time.
Ok so after hours of unsuccessfully scouring the internet I noticed that the 'CustomTool' field in the file properties had a typo in it which was causing the strange error.

I've been asked to deploy, but I cant make the magic happen

I've added a couple of lines to a file, let's say it builds to be foo.dll. It's part of more then one dll file, but it's the core dll. What I did was that I added a couple of lines so it should add some log data to the database. It should not affect any other files what so ever.
So i tried to deploy it. We don't have the magical one click deploy, we are just copying the right files to the right place.
So now, since i have a change in foo.dll, i thought for myself that i just could copy foo.dll and the server would be happy.
I was wrong. Browsing the website i now get "Generic Errors", dont know what that is. I've also tried to copy all the new dll files (4 i total) but that did not solve the problem either.
The error it gives are
Http Error 404.0 not found
Module: ISS Web Core
Notification: MapRequestHandler
Handler: Static File
Error Code: 0x80070002
replacing the new foo.dll with the old one solves the problem. and i've tried to restart the webserver. :-(
I asume you have "published" and not just "compiled" your Web?
You also need to take care off the "Solution Configurations": Debug and Release.
In a normal publish process you would change the configuration to release and publish your project into another folder.
After you have done that you just need to collect the desired files and upload them.
Keep in mind that you need the newest version of you web project. Maybe there are some changes online that your local project hasn'T. This would cause such problems.
We don't have the magical one click deploy
Why not? It's not magic, and it's pretty easy to set up. Get any continuous integration software (I would recommend BuildMaster since I am a developer for it and it's free now) and you'll never have this problem again.

SourceSafe: Can it recover deleted files?

Question: Today I worked with MS Visual Sourcesafe, that is to say Microsoft's Sourcecode destruction system, which has never ever saved anything, but already destroyed much.
Today I had one more of those nasty destructive episodes:
I was working on a reporting service report (*.rdl xml files).
I was modifiying a report, so I created a copy and modified it.
The original being named FILENAME.rdl
My modified copy being named FILENAME2.rdl
I finished, saved. Checked in.
It was all correct.
I switched offline, continued to work.
Later on, I deleted filename.rdl, and renamed filename2.rdl to filename.rdl
I continued working for the rest of the day offline.
In the evening I checked in, and filename2.rdl reappeared.
I thought it had copied the old version back, so I deleted filename.rdl (from local computer and sourcesafe, via the delete keyboard button in the visual studio treeview) and wanted to rename filename2.rdl again to filename.rdl.
When I tried, I realized that filename2.rdl was just an entry that appeared in the treevieww, but not on disk... It was in that very momement that I realized that I now have a problem...
I looked in the recycle bin, but nothing there.
I tried 5 different undelete programms, and shadow copy explorer [to find out that non C drive data - such as the data partition e - is not backed up by the shadow copy service automatically...], but no luck. The file is gone.
Is it possible to still retrieve the file from sourcesafe, or does it get permanently removed when one presses the delete button in VisualStudio treeview and clicks OK on deleting it from file & sourcesafe ?
So far I found this one:
http://support.microsoft.com/?scid=kb;en-us;244019&x=11&y=7
but from that it is unclear whether the file is gone.
The problem is if it isn't there, I should redo the about one hour work this evening, because tomorrow will be a busy day.
There are 2 levels of Delete in SourceSafe. When you delete the file, if you check the "Destroy permanently" option, the file will not be recoverable. Otherwise, you can go to the Properties of its parent project and recover it later.
If it's not stored under some different version or branch of your code, I think you're out of luck.
Regardless, however: you estimate this is one hour's worth of work. You already (presumably) spend some amount of time (probably an hour or two) trying to get the file back. Are you not now at the point where, even if VSS has a way to get your file back for you, you'd be better served just rebuilding it?
Short answer - definitely NO!
It can't! I tried.
But it overwrote the recreated report with a completely wrong recovered version...
Fortunately, I've forseen this, and made a backup copy of the recreated report for this case.
So I didn't spend that one hour of recreating the report in vain.
This program should be forbidden, with noncompliance to this prohibition being subject to the death penalty.

Why don't files automatically get checked out from VSS when I edit them?

This is driving me crazy and has resulted in lost work (not much, at least).
Normally, when I edit a file in Visual Studio, it's supposed to automatically check that file out in source safe. On multi-project solutions (e.g., web app with class libraries), sometimes none of the files in one project would automatically get checked out, though exiting & reloading visual studio may fix that problem temporarily. Furthermore, project files are never automatically checked out. Whenever I add/remove code files, I have to remember to explicitly check out the project file as well (otherwise we'll have issues with code files not showing up in the solution explorer, or trying to load non-existing files).
We're using VS-2008 and VSS 2005. Do you have any idea how I might fix this? There are no more visual-studio updates/fixes on Microsoft Update.
You need to ensure the files are read-only, or VS won't be able to tell that they are version controlled (or, at least that's what it uses to determine it). You can tell VSS to set itself up so getting the latest version places the files RW on disk.
There may be other problems here, but that's what comes to mind first. My advice (that I took myself) is to migrate to SVN or an alternative. Losing work is unacceptable.

Resources