tags:

views:

56

answers:

1

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
    }
}
+3  A: 

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.

Ahmad Mageed
You rock. Thanks.
spender