Could you please tell me how can I get from CompilerError instance exact text which caused the error.
Edited:
What about using
compilerError.FileName
and reading the file with text reader? I am trying to do so but it seems that Compiler doesn’t create cs file that doesn’t pass the compilation any suggestions?
This
CompilerError? : http://msdn.microsoft.com/en-us/library/system.codedom.compiler.compilererror.aspxThere are
FileNameandLineproperties, that’s the best you can get.What are you compiling – is it entirely in-memory (CodeDOM)?
If so you can add code-line pragmas to your object model: http://msdn.microsoft.com/en-us/library/system.codedom.codelinepragma.aspx then you’ll be able to link an error to a DOM element.
Or, you can compile from source, then you’ll have the source code itself and can get the text from the line number.