Get Back Reverted File Visual Studio 2005 - visual-studio-2005

I know this question may be similar to others, but I could not find the solution. My SVN version is 1.8.2 I am using Visual Studio 2005 and I accidentally have reverted a file that I was working on. I watched on Recycle Bin, but could not find that file. What ways are there to get back my reverted file ? I need back not the base file, but my working copy.
Thanks

No, subversion does not have a built in "revert reverted file"-function. You could download a recovery-program and hope that the file hasn't been overwritten so you can recover it.

Related

Files cannot be merged because visual source safe doesn't support merging of files with different encoding

I am working on a project which is on Visual Source Safe(VSS). Me and my colleague were working on the same file. I am working in Visual Studio 2010 with VSS 2005, while my colleague was working in VIsual studio 2013 with VSS 2006.
My colleague committed her changes with no errors, but when I tried to get latest version of the file I am getting this error:
Cannot be merged because visual source safe doesn't support merging of
files with different encoding
The option that worked earlier for such an error is completely deleteing a file from local drive (of course keeping a backup copy!), and then recreating the file from visual studio & copy pasting the content from backup file.
But I am sure there will be some way out as the method I followed earlier doesn't seem to be the best practice.
Also, I cannot check in file; same error arises.
Any help would be appreciated.
Please check your file encoding in Visual Studio and the version in VSS database and see if they are the same.
To check the encoding in VSS, please locate the file in VSS, right click it -> Properties and check Type field.

Tell visual studio to close the documents that have been deleted outside of the IDE

I'm working with Visual Studio 2010 Professional and use git with Git Extensions as a version control system. When I checkout a branch that involves different versions of the files which I'm working on, VS2010 prompt me with a message that says: "this file has been modified outside of the source editor. Do you want to reload it?" I click yes to all, and get the right version of the files. Until here everything goes as expected.
The problem comes when I checkout a branch that involves files to be deleted. Files that in that branch do not exist yet/anymore. If one of these is opened in the editor, it continues there and you can keep writing on it and then save it.
I know the files can't disappear from the project tree, because we're not keeping track of the project files (at least they get in Project File explorer an exclamation mark telling you that the file doesn't exist anymore). What I want is Visual Studio to close each file that no longer exist. Is there a way to do that? Or does someone have an idea to achive this workflow?
Closing and opening Visual Studio again does the trick, actually does exactly what I want.. But it would be good to avoid it.
Thank you
I think you have forgotten to include the project file vbproj or csproj in git

Upgraded from VS 2008 to VS 2010, checked into SVN, still prompting to upgrade

Like the title says, we upgraded our VS2008 solution to VS2010 and checked in the updated solution file to SVN. When I update my local SVN with the changes, and open the solution in VS2010, I still get the "upgrade wizard" prompt telling me the solution needs to be upgraded to VS2010 even though the .sln file has already been upgraded. Trying to open it back in VS2008 gives the expected error that the solution is for a newer version of Visual Studio.
Any idea what is causing this and how to fix it so we don't have to run the upgrade wizard on a solution that's already been upgraded?
I am not sure this is the root of your problem, but it is worth trying.
When a VS2008 project is converted by the wizard (when you convert a solution, the projects get converted as well), a file is created for each project file, with the same name but a different extension: vcxproj instead of vcproj. This file is not versioned by the SVN (since it didn't exist before the wizard did his thing), so it is missing when you SVN-update your solution on the computer where the wizard didn't run.
So, add and commit to the SVN repository all the vcxproj files that were created by the wizard, update the other working copy, and try opening the solution again in VS2010. Btw, the old vcproj files are not needed anymore, so you can remove them from the SVN repository if you are sure no one will need the VS2008 version.

Recover a .CS class file after crash

I was working on a class in visual studio 2010 when suddenly my computer crashes. after I restart the computer. I start Visual studio and I find that class to be completely empty.
it contained more than 1000 lines of codes before the class.
is there anyway i can recover that file?
Help please because I don't have another copy of it (Stupid of me)
If you cannot find the source code file, try using Reflector to decompile the most recently built dll you have containing that class. It won't give you your complete source, but at least will give you something to start with.
Note: Reflector is no longer free; if that matters, try dotPeek from JetBrains instead.
Also, look into using a source code control system. This will let you 'commit' versions of your code to a repository, so you'll have a copy in case something like this happens in the future.
Subversion, Git, and Mercurial are popular ones; In my opinion, Subversion would be the easiest to start out with, especially with TortoiseSVN (OS integration) and AnkhSVN (Visual Studio integration). If you don't want to worry about setting up a repository/server, look into a hosted solution, like Beanstalk, which offers Subversion and Git and lets you try it out with a free, limited account.
Good luck - I hope you are able to recover your source!
Something which worked for me was back-up.
BTW I was trying to recover a VS2013 file on a Windows 8 machine.
Try to check in below location in your system.
C:\Users\username\My Documents\Visual Studio \Backup Files\ProjectFolder
I found an original file with original-date.filename.cs name and a recovered-date.filename.cs files.
The original was the one needed.
Deleted the one in project, added the original file and renamed it to file.cs. Tried building and debugging and it gave the expected results.
Also just want to add one more thing...
In my case i had an aspx page with its respective .cs and designer.cs
The .cs file got corrupted and I did build on project, with the designer.cs the project got build successfully and the dll got replaced. And when i tried to recover using reflector everything was in a state no return. :(
So don't build the project if you see any file got corrupted.
in visual studio 2019 I find the file in a files with TMP extension
FileName.cs~xxxxxxxx.TMP
This happened to me a few times as well when Visual Studio was crashed or System was shutdown unexpectedly.You can recover these corrupted file using Recuva. It dose not recover the file every time but in most of the cases it's work perfectly.
Below are the settings which you need to configure before recovery.
Start Recuva. Enter Advanced mode if the Wizard launches.
Click Options.
In the Options dialog box, click the Actions tab.
Click Scan for non-deleted files, and then click OK.
Run the Recuva scan as normal. Non-deleted files are indicated with a green double-circle status icon.
Hopefully, you will find your corrupted file in recovered files as it recover multiple versions for that file.
Very useful question. I got issue of file crash on sudden shutdown of my PC. recovered file using "Recuva"(download link: https://filehippo.com/download_recuva/) software. Scan for non-deleted files was helpful.
I got help from: https://www.samnoble.co.uk/2014/11/30/visual-studio-crashes-and-a-corrupted-cs-file/
Well, that happen recently for me and I did get my file back this way.
1. Find the project DLLs in the bin folder. Example MySolution.dll
2. Download and Install .Net Reflector from https://www.red-gate.com/products/dotnet-development/reflector/trial/thank-you
3. Open the .Net Reflector app and click the open folder icon then move to your bin directory and select MySolution.dll file
4. Then traverse and expand through your namespaces and classes to look into your codes.
5. Have fun!

Adding images to SubVersion through Visual Studio using AnkhSVN - issues?

For the most part, AnkhSVN is working well with VS2008. The only issue I'm seeing is when an image is added from one dev, it is not added to any other machines when the SubVersion Update to Latest Version is executed.
The log file shows that the image was in fact added and submitted to SVN, but no file is downloaded added locally.
So far I've only seen this with .gif files.
Any tips?
Thanks.
See here for why this is and how to resolve it:
SVN: Colleague checked in a folder into repository, but I can't Update my version to it
Subversion is not natively supported by Visual Studio 2008. Which add-on are you using to access Subversion?
I would use the SVN command line client or TortoiseSVN to do a checkout of the source code and see whether it is committed properly. Then take a look at whether the project files have a reference to the file at all.
I don't suppose you've added .gif files to your excluded list, right? It's tough to do that unintentionally. Worth at least looking at.
Did you also commit the project file. Most project files keep a list of items that should be included in the project. Adding a new file also adds it to that list.

Resources