473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

CSharpCodeProvider: Stack trace line numbers on exceptions?

I'm using C# as a sort of scripting language by having text entered by my
user compiled using the CSharpCodeProvider and run, with references to an
assembly that has utility functions in it.

When an exception is thrown by my dynamically-compiled assembly, I can get a
stack trace on the exception, but it doesn't show what line the error
occurred on. I need to be able to tell my user where their error occurred.

It doesn't seem to matter if IncludeDebugInformation is true or false on my
CompilerParameters. I tried compiling from temporary files rather than
directly from a string in memory, but it had no effect.

How can I get line numbers on stack traces for exceptions thrown by
dynamically-compiled assemblies?
~BenDilts( void );
Jun 27 '08 #1
0 1108

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: JP | last post by:
I managed to get error checking does in my application. In using the Exception object I can get all the information I need about the error like the line # where the exception occurred. IS there a...
3
by: Mike Schilling | last post by:
Instances of SystemOutOfMemoryException do not contain a stack trace. Easy test to verify this: class OOM { public static void Main() { try { Object arr = new Object; } catch...
3
by: Jim Heavey | last post by:
My application abends when I press a tab on the tab control. I have tried to trace what is happening, but is never shows me the line of code which is failing, I only get a message box telling me I...
1
by: | last post by:
Hi all i posted this question yesterday. no answers yet. please do reply if you have any ideas. thanks a lot. Subject: stack frame stack trace can the information from the stack be obtained...
0
by: Mike Schilling | last post by:
I have some code that calls methods reflectively (the method called and its parameters are determined by text received in a SOAP message, and I construct a map from strings to MethodInfos). The...
2
by: Lasse Vågsæther Karlsen | last post by:
If I got the following code: try { // something that might throw an exception } catch (Exception ex) { // Log contents of ex here throw;
4
by: TS | last post by:
I have an application on one server that shows line numbers in stack trace, but on another server the "in c:\xxx.aspx:line 9999" part that accompanies the "at" part doesn't show. Besides this...
2
by: pavel.orehov | last post by:
Hi, I am using Environment.StackTrace to print the stack trace to the log when I have any exceptions in my application. When I work in development environment I see the line numbers in the...
3
by: Paul McGuire | last post by:
Is there any way to hide portions of an exception stack trace? When users get exceptions when using pyparsing, there are usually many layers of pyparsing-internal stack messages that are not at...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.