Skip to content
This repository has been archived by the owner on Dec 8, 2018. It is now read-only.

Exceptions during razor views rendering don't show the source line #293

Closed
sebastienros opened this issue May 17, 2016 · 5 comments
Closed
Assignees
Milestone

Comments

@sebastienros
Copy link
Member

Can repro in a new WebApp from template.

Repro:

  • Update Index.cshtml with @(((string)null).ToString()

Result:
image

Expected:
It should display the line number where the exception occurred.

NB:

  • Looking at the sourceTree value the line numbers are generated in the razor source.
  • This scenario should be added in release checks
@Eilon Eilon added this to the 1.0.0 milestone May 18, 2016
@pranavkm
Copy link
Contributor

Seems like an issue with compiling using the PortablePdb switch. I asked the Roslyn folks at dotnet/roslyn#11535 for guidance on this.

@pranavkm
Copy link
Contributor

The issue's been fixed for RTM - https://github.com/dotnet/coreclr/issues/3906. We're working on picking up the packages now so this is likely to get fixed soon. I filed aspnet/Mvc#4737 to add a functional test to verify this behavior is covered.

@pranavkm
Copy link
Contributor

The RC3 packages fix this issue in netcoreapp, but it's broken on desktop. I guess we could generate full pdbs if the right components are present. @davidfowl, does that sound ok?

pranavkm added a commit to aspnet/Mvc that referenced this issue May 27, 2016
Add a test to verify exceptions thrown from views is pretty printed by diagnostics middleware

Fixes aspnet/Diagnostics#293
Fixes #4737
pranavkm added a commit to aspnet/Mvc that referenced this issue May 28, 2016
Add a test to verify exceptions thrown from views is pretty printed by diagnostics middleware

Fixes aspnet/Diagnostics#293
Fixes #4737
pranavkm added a commit to aspnet/Mvc that referenced this issue May 28, 2016
Add a test to verify exceptions thrown from views is pretty printed by diagnostics middleware

Fixes aspnet/Diagnostics#293
Fixes #4737
@dougbu
Copy link
Member

dougbu commented May 29, 2016

@pranavkm why is dotnet/coreclr#3906 considered closed if the problem is only fixed when using .NET core? Have you filed a CoreFx bug for full desktop support?

pranavkm added a commit to aspnet/Mvc that referenced this issue May 29, 2016
Add a test to verify exceptions thrown from views is pretty printed by diagnostics middleware

Fixes aspnet/Diagnostics#293
Fixes #4737
@pranavkm
Copy link
Contributor

pranavkm commented Jun 1, 2016

@davidfowl's going to commonize the pdb reader (#300) and use it in Hosting and Diagnostics. I'll check in the test part of aspnet/Mvc@73ddec7 once this is done to get some e2e coverage.

@pranavkm pranavkm removed their assignment Jun 1, 2016
pranavkm added a commit to aspnet/Mvc that referenced this issue Jun 9, 2016
Add a test to verify exceptions thrown from views is pretty printed by diagnostics middleware

Fixes aspnet/Diagnostics#293
Fixes #4737
@pranavkm pranavkm assigned pranavkm and unassigned davidfowl Jun 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants