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

  • Home
  • SEARCH
  • 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 7938419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:48:32+00:00 2026-06-03T22:48:32+00:00

I have this method that logs errors from the Silverlight client: [MethodImpl(MethodImplOptions.NoInlining)] public static

  • 0

I have this method that logs errors from the Silverlight client:

[MethodImpl(MethodImplOptions.NoInlining)]
public static bool ErrorHandler(Exception error, bool showError = true)
{
    string callingMethod = new StackFrame(1).GetMethod().Name;

    //write log - call webservice
    //show error that some error happened if showError is true
}

my problem is this, that when I run the app and call a method that throws an exception it logs like this:

<ThrowExceptionMethod>b__72: test

but when someone that has a normal (non-developer runtime) runs this app and throws an exception it logs like this:

b__72: test

I’m only guessing that this is due SDK Silverlight runtime. It’s hard to tell, because most of my colleagues have Silverlight SDK installed… Could someone confirm if this is the reason for this anomaly.

SOLVED!

It was not due SDK runtime, it was just because I call anonymous methods.
I added this line of code to it:

var listStackFrame = new List<StackFrame>();

for (int i = 1; i < 20; i++)
{
    listStackFrame.Add(new StackFrame(i));
}

string callingMethod = string.Empty; //new StackFrame(1).GetMethod().Name;

foreach (var item in listStackFrame
    .Where(m => m != null && m.GetMethod() != null && !string.IsNullOrEmpty(m.GetMethod().Name) && m.GetMethod().Name.Contains("__")))
{
    callingMethod += item.GetMethod().Name + "->";
}

I am not worried about how much this eats up resources, because after all an exception has occured and the user will stop whatever he is doing and contact support.

  • 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-03T22:48:33+00:00Added an answer on June 3, 2026 at 10:48 pm

    That’s usually because what you are executing is actually a yield iterator or anonymous delegates delegate (there may be other cases I’m missing). What happens is that the compiler actually create new methods and even classes for most of the syntactic sugar.

    I think you can iterate all the previous methods call looking for the first that doesn’t have the [CompilerGenerated] attribute.

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

Sidebar

Related Questions

I have a method that looks like this: public static String escape(String text) {
I have a method that looks like: T[] field; public Method(IList<T> argument) { this.field
I have this method that changes an larger image source on click. I need
I have this method in App Delegate that makes a window and content view
I have a method with this signature, and another method that will be the
Say I have a method that returns this. Vector[ (PkgLine, Tree) ]() I want
I have a controller method that is a little something like this: def suggestions
Is there builtin method that would do this or do I always have to
Let's say that I have a method that looks like this: def raise_if_client_status_error(xml_resp) #
I have a Cocoa/Objective-C class with a method that looks something like this: -

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.