Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8352009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:49:44+00:00 2026-06-09T08:49:44+00:00

I have a quick-and-dirty unit test framework for my ASP.NET application — an ASPX

  • 0

I have a quick-and-dirty unit test framework for my ASP.NET application — an ASPX page with a method that compares expected and actual results and creates a table. It compiles as needed and lets me create and run a bevy of tests quickly, even without VS.NET running.

Here’s an example call:

PrintResult(
   expected:  "$A$1", 
   actual:    RST.ExcelReference.FormatReferences("{{REF:1:0:1:0}}", false, 0, 0),
   arguments: "RST.ExcelReference.FormatReferences(\"{{REF:1:0:1:0}}\", false, 0, 0)");

(Named arguments added for clarity.)

As you can imagine, synchronizing the actual call and the display of that call is a pain.

I know I can’t examine argument values in Environment.StackTrace, only the method definition and line number. But in my case, I don’t need actual argument values. I’m generally calling this method using literals as arguments, so all I need is the line of source code for the entry point into PrintResult() in the Stack Trace.

The source code seems to be available to ASP.NET somehow, as it appears when there is an unhandled exception. How can I access it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:49:46+00:00Added an answer on June 9, 2026 at 8:49 am

    Environment.StackTrace provides you with the file name and line number in each line of the stack trace. It is clearly formatted and should be easily parseable. From the documentation:

    The StackTrace property formats the stack trace information for each
    method call as follows:

    “at FullClassName. MethodName (MethodParams) in FileName :line
    LineNumber “

    The literal “at” is preceded by three spaces, and the literals “in”
    and “:line” are omitted if debug symbols are not available. The
    placeholders, FullClassName, MethodName, MethodParms, FileName, and
    LineNumber, are replaced by actual values defined as follows:

    FullClassName The full name of the class, including the namespace.

    MethodName The name of the method.

    MethodParms The list of parameter type/name pairs. Each pair is
    separated by a comma (“,”). This information is omitted if MethodName
    takes zero parameters.

    FileName The name of the source file where the MethodName method is
    declared. This information is omitted if debug symbols are not
    available.

    LineNumber The number of the line in FileName that contains the source
    code from MethodName for the instruction that is on the call stack.
    This information is omitted if debug symbols are not available.

    In the question you implied that Environment.StackTrace is not the answer to your question, but it seems like you should be able to parse out the source file name and line number, then go read that line from the file. What am I missing?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a quick-and-dirty in-house ASP.NET application that needs to be able to
I have a JTable in a swing application. I wrote a quick and dirty
I'm using JAXB for quick-and-dirty XML generation. I have a class that represents a
I have been trying to whip up a quick and dirty application. This application
I am writing a quick and dirty application that reads all the files from
I have a quick question that I can't seem to find online. I am
I wrote a quick and dirty web service in VB.NET. And as it always
I'm trying to create a quick and dirty simple menu that is generated by
I wrote a quick and dirty function to compare file contents (BTW, I have
First is it dumb to use DJango as a quick/dirty data access method? We

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.