locked
Line numbers in stack traces in Linux RRS feed

  • Question

  • User-1262787652 posted

    ASP .NET MVC Core application is publised to Debian Linux server

    Configuration: Debug

    Target framework net5.0

    Target runtime linux-x64 

    options are selected and silnge file is not selected.

    application is copied to Debian including .pdb files. On error deveper page does not show line numbers:

    An unhandled exception occurred while processing the request.
    RazorEngineCompilationException: Unable to compile template: kg1kac1e.11k(5,7): error CS0103: The name 'tml' does not exist in the current context
    RazorEngineCore.RazorEngine.CreateAndCompileToStream(string templateSource, RazorEngineCompilationOptions options)
    
    Stack Query Cookies Headers Routing
    RazorEngineCompilationException: Unable to compile template: kg1kac1e.11k(5,7): error CS0103: The name 'tml' does not exist in the current context
    RazorEngineCore.RazorEngine.CreateAndCompileToStream(string templateSource, RazorEngineCompilationOptions options)
    RazorEngineCore.RazorEngine.Compile<T>(string content, Action<IRazorEngineCompilationOptionsBuilder> builderAction)
    Eeva.Library.RazorRenderer+<>c__DisplayClass1_0<TModel>.<Render>b__0(int i) in I:\myapp\RazorRenderer.cs
    System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
    Eeva.Library.RazorRenderer.Render<TModel>(string template, TModel model) in I:\myapp\RazorRenderer.cs
    Eeva.Web.ViewPageBase<TPageModel>.Hook(ElementName elementName, bool userazor) in I:\myapp\ViewPageBase.cs
    AspNetCore.Views_Shared__Layout.<ExecuteAsync>b__23_1() in I:\myapp\Store\Views\Shared\_Layout.cshtml
    Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
    AspNetCore.Views_Shared__Layout.ExecuteAsync()

    If application is running from Visual Studio IDE developer page shows line numbers (49. in this sample) and source code lines in red:

    An unhandled exception occurred while processing the request.

    RazorEngineCompilationException: Unable to compile template: mabcc1lr.jjw(6,7): error CS0103: The name 'Htm' does not exist in the current context

    RazorEngineCore.RazorEngine.CreateAndCompileToStream(string templateSource, RazorEngineCompilationOptions options)

    • RazorEngineCompilationException: Unable to compile template: mabcc1lr.jjw(6,7): error CS0103: The name 'Htm' does not exist in the current context


    RazorEngineCore.RazorEngine.CreateAndCompileToStream(string templateSource, RazorEngineCompilationOptions options) RazorEngineCore.RazorEngine.Compile<T>(string content, Action<IRazorEngineCompilationOptionsBuilder> builderAction) Eeva.Library.RazorRenderer+<>c__DisplayClass1_0<TModel>.<Render>b__0(int i) in RazorRenderer.cs + 49. var compiledTemplate = razorEngine.Compile<RazorEngineCorePageModel<TModel>>(template, builder => System.Collections.Concurrent.ConcurrentDictionary<TKey, TValue>.GetOrAdd(TKey key, Func<TKey, TValue> valueFactory) Eeva.Library.RazorRenderer.Render<TModel>(string template, TModel model) in RazorRenderer.cs + var compiledTemplate = (IRazorEngineCompiledTemplate<RazorEngineCorePageModel<TModel>>)

    How to show sourcve code line numbers in developer page in Linux ?

    Friday, January 8, 2021 11:02 PM

All replies

  • User-474980206 posted

    c# on linux is the same as windows. to get line numbers it must be a debug build (otherwise they are optimized out). the .pdb file with optimized binary will allow looking at global symbols via the debugger. 

    but you error look like it from a library doing a dynamic compile. you should check the documentation if it supports better compile errors.

    Saturday, January 9, 2021 1:29 AM