LinqPad刚刚撞我了。我的代码在磁盘上的任何地方? [英] LinqPad just crashed on me. Is my code anywhere on the disk?

查看:97
本文介绍了LinqPad刚刚撞我了。我的代码在磁盘上的任何地方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在制作略微小于琐碎的东西时崩溃了LinqPad。我不想重新启动它,直到我确定不会危及恢复我的工作(如果这是可能的)。我的问题是:LinqPad写临时文件anyware,可能仍然包含我写的代码?

I crashed LinqPad while crafting something slightly less than trivial. I don't want to restart it until I'm sure that won't jeopardise recovering my work (if this is possible). My question is: Does LinqPad write temp files anyware that might still contain the code I wrote?

对于后代,这里是一个测试用例每次崩溃LinqPad LinqPad论坛 a>):

For posterity, here's a test case that crashes LinqPad every time (also posted to LinqPad forum):

void Main()
{
    Crasher.Crash();
}
class Crasher
{
    public static void Crash()
    {
        var a=0;
        Crash();
        a++; //let's get something in the tail so compiler 
             //doesn't optimise tail recursion and prevent
             //stackoverflow
    }
}


推荐答案

在崩溃之前你碰巧运行一次?如果是这样,它将被编译,并且应该可用作dll,您可以使用 .NET打开

Before the crash did you happen to run it once? If so it would've been compiled and should be available as a dll that you can open with .NET Reflector.

检查LINQPad临时文件夹,例如: C:\Documents和Settings \username\Local Settings \Temp\LINQPad 。按修改日期排序文件,然后检查几个dll在反射器,直到你找到你的查询。

Check the LINQPad temp folder, for example: C:\Documents and Settings\username\Local Settings\Temp\LINQPad. Sort the files by modified date then check a few of the dlls in Reflector till you find your query. It probably won't resemble your query exactly but it should be good enough for you to salvage your code.

UPDATE:一个自动恢复功能功能已添加到LINQPad(Beta,在撰写本文时)。据我所知,它早于v4.28.3就已经在测试版中提供。获取测试版以利用它,或者它可能已经在发布版本为未来的读者的这篇文章。如果LINQPad在崩溃后启动,它会弹出一个对话框,询问您是否要恢复未保存的查询。

UPDATE: an auto-recovery feature has been added to LINQPad (Beta, at the time of this writing). To my knowledge it has been available in the Beta version as early as v4.28.3. Get the beta to take advantage of it, or it may already be in the release version for future readers of this post. If LINQPad is launched after it crashes it will throw a dialog up asking whether or not you would like to recover unsaved queries.

这篇关于LinqPad刚刚撞我了。我的代码在磁盘上的任何地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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