LinqPad 刚刚崩溃了。我的代码在磁盘上的任何位置吗?

发布于 2024-09-26 23:37:01 字数 592 浏览 0 评论 0原文

我在制作一些不那么简单的东西时使 LinqPad 崩溃了。我不想重新启动它,直到我确定这不会危及我的工作恢复(如果可能的话)。我的问题是:LinqPad 是否会编写可能仍包含我编写的代码的临时文件?

对于后代,这里有一个每次都会使 LinqPad 崩溃的测试用例(也发布到 LinqPad 论坛):

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
    }
}

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?

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
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小情绪 2024-10-03 23:37:01

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

检查 LINQPad 临时文件夹,例如:C:\Documents and Settings\username\Local Settings\Temp\LINQPad。按修改日期对文件进行排序,然后检查 Reflector 中的一些 dll,直到找到您的查询。它可能不会完全类似于您的查询,但它应该足以让您挽救您的代码。

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

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.

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: 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文