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 8851129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:04:29+00:00 2026-06-14T13:04:29+00:00

I am trying to implement somewhat more sophisticated error handling. To achieve my goal,

  • 0

I am trying to implement somewhat more sophisticated error handling. To achieve my goal, I need to filter out non-user code methods (frames) from curent StackTrace.

In ASP.NET typical StackTrace as you can probably guess the are many methods that are quite irrelevant for debugging purposes as they are outside of the user code. Visual studio gives you option to filter out this non-user code (frames) so I am guessing its possible. However after about 30 minutes of exploring methods and properties of StackFrames (and methods, modules, assemblies, … ) I couldnt find any that could be used to identify “system” frames.

I have ended up with manual specification of which modules I want to log (module is part of assembly, in my case 1:1).

Is there any better way to do this? Simply include everything outside core ASP.NET.

  • 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-14T13:04:31+00:00Added an answer on June 14, 2026 at 1:04 pm

    StackFrame class has the GetMethod() member function, from retrieved MethodBase object.

    If all you need is a naive filter you may do one of these:

    • Strip out every method in a class which starts with “System.” or “Microsoft.” (because all .NET libraries are placed there).
    • Find the assembly where a method is (see forward) then check for AssemblyCompanyAttribute and filter assemblies made by “Microsoft Corporation”). This is better than previous method because sometimes I saw libraries which put their own types inside System namespace.

    If you need something more you can get the module (MethodBase.Module) where that method is defined. Now you have two options:

    • If all your assemblies are signed you can show only methods with that public key token (get the assembly where the module is defined with Module.Assembly property, build an AssemblyName object with Assembly.FullName then check the public key for AssemblyName.KeyPair property, it must match your public key token (simply compare with GetExecutingAssembly()).
    • If not all your assemblies are signed you can do the same operation but filtering out all the assemblies that matches the public key token of system assemblies (this may be the simplest case and it’ll include 3rd part libraries too).

    Please note that not all system assemblies have the same public key token (even within the same Framework version) so you must collect and check a list of keys (just browse c:\windows\assembly to read them). A good approach could be to check for public key and then apply a second filter using AssemblyCompanyAttribute.

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

Sidebar

Related Questions

SetFocus I'm trying implement the above Se Focus code in a Class Library that
This is somewhat of a complex question. I've been trying to implement a system
I'm somewhat trying to implement a kind of copy operator. The aim is to
I'm trying to implement a function within a Class method and I am somewhat
I am somewhat new to RESTful APIs. I'm trying to implement a python system
I'm trying to figure out how to implement my first RESTful interface using Django
I'm trying to implement a program in Xcode that's somewhat like a command line.
I'm trying to implement Strassen Matrix multiplication in Python. I've got it working somewhat.
I'm trying implement A* Start path finding in my games(which are written with JavaScript,
I am trying implement a most recent widget into my tumblr post. So far,

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.