如何从Visual Studio 2010制作的调试文件夹中恢复数据/代码? [英] How can i recover data/code from visual studio 2010 made debug folders?

查看:178
本文介绍了如何从Visual Studio 2010制作的调试文件夹中恢复数据/代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个严重的问题,我的硬盘昨天崩溃了,上面有很多项目。我丢失了大多数项目,但是恢复的是我发送给客户端的所有调试文件夹(大多数是桌面应用程序) 。我无法恢复大部分工作的代码,但是我确实有调试文件夹,我的问题是有什么办法可以从它们恢复代码。
我确信您过去曾经经历过,如果您有任何相关信息,请提供帮助。



debug文件夹中的文件:示例我使应用程序苹果

  apple.exe type = application 
apple.pdb type = PDBFIle
apple .vshost类型=应用程序
apple.vshost.exe.mainfest类型=清单文件

附加信息:



我的笔记本电脑硬盘崩溃了,所以我目前正在将它用作另一台笔记本电脑的USB驱动器。我有3个分区,但现在我看到4个i,j,k,l。其中一个曾经是我的D:驱动器可以正常工作,我看到它显示出150 GB中的72 GB可用空间。其余的它们只是没有信息,当我几分钟没有单击它们时,它说格式化驱动器等...如果您知道如何修复,那将是很棒的事情。



谢谢

解决方案

您真的很幸运能够访问包含已编译二进制文件的Debug文件夹。使用托管语言(C#)的事实意味着您可以使用许多.NET反编译器之一以可读格式显示它们包含的源代码。它可能与您最初在Visual Studio中键入的内容完全不同,但会非常接近-比系统崩溃时的正常情况要好。



我曾经为此任务推荐Redgate的,以供将来存储代码时使用。所有明智的开发人员都出于许多原因使用它。使用Google搜索查找更多信息。有很多不同的选择。您选择哪一个并不重要;重要的是您选择一个!


I have a serious issue, my harddisk crashed yesterday , and i had tons of projects on it .I lost most of them but the ones i recovered are all the debug folders i sent to clients (most of them are desktop applications). I am unable to recover the code for most of the work , but i do have debug folders , my question is is there any way that i can recover my code from them. I am sure some one you would have gone through it in the past, please help if you have any information regarding this.

Files in the debug folder:Example i make application apple

apple.exe                     type=application
apple.pdb                     type=PDBFIle
apple.vshost                  type=Application
apple.vshost.exe.mainfest     type=MANIFEST File

ADDITIONAL INFO:

My laptop hardisk crashed so i am currently using it as a usb drive with another laptop . I had 3 partitions but now i see 4 i,j,k,l . One of them which used to be my D: drive working fine, i see it shows 72 GB free out of 150 GB. Rest of them they are just there no info, when i click them nothing for minutes then it says format drive etc... If you know how to fix that that would be wonderful.

Thank you

解决方案

You really lucked out with having access to the Debug folders containing your compiled binaries. The fact that you're working in a managed language (C#) means that you can use one of the many .NET decompilers to display the source code that they contain in a readable format. It may not be exactly the same as what you initially typed into Visual Studio, but it will be pretty darn close—way better than can normally be expected in the event of a system crash.

I used to recommend Redgate's .NET Reflector for this task, but they recently decided to eliminate the free version of their decompiler utility and adopted some business practices that I personally disagreed with. Then again, their tools are probably still the best around, so you might consider downloading their 30-day trial to attempt to get your code back. Who knows, you might like it so much that you buy!

If you're a cheapskate like me, or a devotee to truly free software, you can try one of the free alternatives that cropped up after Reflector became not free, like ILSpy, developed by the same people who develop SharpDevelop. Even more alternatives are listed here.

Whichever decompiler utility you choose, download a copy and open its executable. Then from the "File" menu, choose "Open", and navigate to the first compiled .exe from which you want to recover source. The utility will display the name of your application and some metadata about your assembly. From here, you can make sure that you opened the correct file.

In both ILSpy and .NET Reflector, you can click the [+] toggle next to your application's name to expand its listing. You'll see a bunch more expandable items, like References (the DLLs that your application uses), Resources (the resource files compiled into your application), and the namespaces defined in your code. Expanding an individual namespace will show you all of the types defined in that namespace, and expanding a type will show you all of the types, methods, members, etc. defined in that type, and so on down the hierarchy. Clicking on individual items in the source tree to the left will display the decompiled code in the output pane to the right; both ILSpy and .NET Reflector support displaying the code as C#, which should look very readable to you.

For example, using ILSpy to open the ILSpy.exe application itself produces the following output:

 

You really can't break anything in here, so navigate around, exploring and seeing what all can be recovered, amazed at how well this works. Everything works just as well with DLLs as it does with EXEs.

Then get started copying and pasting...

The next order of business is getting your system stable again. If you had a hard disk crash, you definitely don't want to trust that drive ever again! Run out and buy a new one immediately, wipe it, and reload Windows.

Once you finish with that, you definitely want to get on setting up a source/version/revision control system to use in the future to store your code. All smart developers use this for so many reasons. Find more information with a Google search. There are lots of different options. Which one you pick is not important; the important thing is that you pick one!

这篇关于如何从Visual Studio 2010制作的调试文件夹中恢复数据/代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆