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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:31:40+00:00 2026-05-16T21:31:40+00:00

I followed this example from Scott Hanselmans webpage: http://www.hanselman.com/blog/ReleaseISNOTDebug64bitOptimizationsAndCMethodInliningInReleaseBuildCallStacks.aspx My goal is to get

  • 0

I followed this example from Scott Hanselmans webpage:
http://www.hanselman.com/blog/ReleaseISNOTDebug64bitOptimizationsAndCMethodInliningInReleaseBuildCallStacks.aspx

My goal is to get the line number from where the exception is thrown not where it is caught.

When I compile the code with the following build-script it wont work

SET FXROOT=%Systemroot%\Microsoft.NET\Framework\v4.0.30319

DEL *.exe /q

"%FXROOT%\csc.exe" /t:exe /out:NormalRelease.exe /debug:pdbonly /o+ NormalProgram.cs

NormalRelease.exe > NormalRelease32.txt

Output:

System.ApplicationException: generic bad thing
   at NormalProgram.Main(String[] args) in c:\Development\DebugSymbols\DebugSymConsole\NormalProgram.cs:line 8

When I compile the code with this build-script it will work

SET FXROOT=%Systemroot%\Microsoft.NET\Framework\v2.0.50727

DEL *.exe /q

"%FXROOT%\csc.exe" /t:exe /out:NormalRelease.exe /debug:pdbonly /o+ NormalProgram.cs

NormalRelease.exe > NormalRelease32.txt

Output:

System.ApplicationException: generic bad thing
   at NormalProgram.badMethod() in c:\Development\DebugSymbols\DebugSymConsole\NormalProgram.cs:line 18
   at NormalProgram.Main(String[] args) in c:\Development\DebugSymbols\DebugSymConsole\NormalProgram.cs:line 8

The difference is that in my first example i compiled against the .net2-framework, and in my second example I compiled against the .net4-framework.

Any solutions to my problem would be appreciated, thanks.

  • 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-05-16T21:31:40+00:00Added an answer on May 16, 2026 at 9:31 pm

    This is something you are going to have to deal with if you expect to generate line numbers from code generated in the Release configuration. The JIT compiler’s optimizer is enabled and it is going to move code around to create more efficient machine code. That’s going to affect the accuracy of the reported line number.

    The specific workaround here is to apply this attribute to “badMethod”:

    using System.Runtime.CompilerServices;
    ...
            [MethodImpl(MethodImplOptions.NoInlining)]
            void badMethod() {
                // etc...
            }
    

    This is not a joyful workaround, inlining is an important optimization, especially on property getter/setters. The reason it is different between .NET 2.0 and 4.0 is because they have different jitters with different rules for deciding when a method should be inlined.

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

Sidebar

Related Questions

Hi i have a problem with recursion. i followed this example from wc3 http://www.w3schools.com/jsref/met_win_settimeout.asp
I am trying to follow this example from MSDN: http://msdn.microsoft.com/en-us/library/a1hetckb.aspx I think i'm doing
I followed this example to get the required dependencies injected into my AbtractMavenLifecyleParticipant: http://www.sonatype.com/people/2011/01/how-to-use-aether-in-maven-plugins/
I followed this tutorial http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html I wrote the manifest File giving all the permissions
I followed this tutorial http://stevejenkins.com/blog/2011/08/how-to-install-apc-alternative-php-cache-on-centos-5-6/ to install apc on my centos vps hosting but
I found and followed an example from Stackoverflow (http://stackoverflow.com/questions/2310139/how-to-read-xml-response-from-a-url-in-java) of how to read an
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call
I've just followed this example from Wordpress and I have successfully added an extra
I followed this tutorial: http://codeigniter.com/wiki/Internationalization_and_the_Template_Parser_Class/ The controller that loads the language is this one:
I followed the example from this site to eliminate the issues with static vs

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.