title: Saving C# Expression Tree to a File
body: <p>I want to debug an expression and save the expression tree to a file:</p>
  
  <pre><code>var generator = DebugInfoGenerator.CreatePdbGenerator();
  var document = Expression.SymbolDocument(fileName: "MyDebug.txt");
  var debugInfo = Expression.DebugInfo(document, 6, 9, 6, 22);
  var expressionBlock = Expression.Block(debugInfo, fooExpression);
  var lambda = Expression.Lambda(expressionBlock, parameters);
  lambda.CompileToMethod(method, generator);
  var bakedType = type.CreateType();
  return (type)bakedType.GetMethod(method.Name).Invoke(null, parameters);
  </code></pre>
  
  <p>How can I find or save "MyDebug.txt"?</p>