Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error message line without being in debug mode

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Error message line without being in debug mode

    Hi, i have an extension method that shows me the line number of the error in VS2019, this also works without problems, but unfortunately only in debug mode. is it possible to get this also in non debug mode? if i copy the *.pdb file needed for this into the custom folder, it is deleted after nt compiles and only 0 is displayed again.

    Debug Mode:
    Code:
    19.03.2021 11:46:34:000 [SidiSystemBase]-[ID=227614025]-[Void OnBarUpdate()]-[[B][COLOR=#c0392b]Line=2528]-[Column=17]-[FileName=c:\Users\***\***\Dokumente\NinjaTrader 8\bin\Custom\Strategies\SidiSystemBase.cs][/COLOR][/B]-[LogLevel=Error]
    non Debug Mode:
    Code:
    19.03.2021 11:46:34:000 [SidiSystemBase]-[ID=227614025]-[Void OnBarUpdate()]-[COLOR=#c0392b][B][Line=0]-[Column=0]-[FileName=][/B][/COLOR]-[LogLevel=Error]
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    #2
    Hello sidlercom80,

    From the given details it sounds like you are using some C# debug mode properties to print the line number. Without more details on what specific C# property or methods you are using I would guess that what you are seeing is correct and relies on debug mode being enabled.

    You can do a test to see if this relates to C# debug/release, you could make an external C# application in visual studio and try this code in that context. If placing the code in release mode prevents it from working that would be your answer. NinjaTrader's debug mode is simply leveraging the C# compiler options to enable debug/release modes on the visual studio project that is being used. The debug symbols and other debug data would be removed when debug mode is not enabled to make sure no residual files are left so that is also expected.

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X