Line number and path or file name missing when logs maintain in azure applicationinsights for blazorWASM application

ramesh P 0 Reputation points
2025-04-03T12:46:56.4833333+00:00

I had develop blazorWASM application logs using these links. I had used .NET core 6.0.I had use ILoggers<Type> logger

https://stackoverflow.com/questions/69556945/adding-application-insights-on-blazor-client-web-assembly

https://learn.microsoft.com/en-us/answers/questions/1384497/blazor-8-support-for-application-insights

https://github.com/IvanJosipovic/BlazorApplicationInsights

log works fine but when check logs in azure application insights at the time loggers are maintained by azure but where exception occured like Line number and path or file name missing at production

but i need both for slove the issue where the issue happened but method names shown in application insights

Please help me.

Thank you.

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,672 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 75,051 Reputation points
    2025-04-05T01:02:01.09+00:00

    The line numbers are in the symbol file (.pdb). Blazor WASM does not have code to load the symbol file and process on exceptions. In debug mode the debugger loads the symbol file and provides the translation of address to line number.

    note: in .net core, you need is disable code optimization for the line numbers to be accurate.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.