{"action":"created","issue":{"url":"https://api.github.com/repos/khellang/Middleware/issues/70","repository_url":"https://api.github.com/repos/khellang/Middleware","labels_url":"https://api.github.com/repos/khellang/Middleware/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/khellang/Middleware/issues/70/comments","events_url":"https://api.github.com/repos/khellang/Middleware/issues/70/events","html_url":"https://github.com/khellang/Middleware/issues/70","id":498802386,"node_id":"MDU6SXNzdWU0OTg4MDIzODY=","number":70,"title":"Exception in DeveloperProblemDetails.GetErrors() while executing the execute the problem details middleware","user":{"login":"cremor","id":116314,"node_id":"MDQ6VXNlcjExNjMxNA==","avatar_url":"https://avatars1.githubusercontent.com/u/116314?v=4","gravatar_id":"","url":"https://api.github.com/users/cremor","html_url":"https://github.com/cremor","followers_url":"https://api.github.com/users/cremor/followers","following_url":"https://api.github.com/users/cremor/following{/other_user}","gists_url":"https://api.github.com/users/cremor/gists{/gist_id}","starred_url":"https://api.github.com/users/cremor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cremor/subscriptions","organizations_url":"https://api.github.com/users/cremor/orgs","repos_url":"https://api.github.com/users/cremor/repos","events_url":"https://api.github.com/users/cremor/events{/privacy}","received_events_url":"https://api.github.com/users/cremor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2019-09-26T10:34:33Z","updated_at":"2019-10-01T07:16:30Z","closed_at":null,"author_association":"NONE","body":"I sometimes get the following exception in my server log:\r\n\r\n```\r\nAn exception was thrown attempting to execute the problem details middleware.\r\nSystem.BadImageFormatException: Invalid directory size.\r\n   bei System.Reflection.PortableExecutable.PEReader.ReadDebugDirectory()\r\n   bei Microsoft.Extensions.StackTrace.Sources.PortablePdbReader.GetPdbPath(String assemblyPath)\r\n   bei Microsoft.Extensions.StackTrace.Sources.PortablePdbReader.GetMetadataReader(String assemblyPath)\r\n   bei Microsoft.Extensions.StackTrace.Sources.PortablePdbReader.PopulateStackFrame(StackFrameInfo frameInfo, MethodBase method, Int32 IlOffset)\r\n   bei Microsoft.Extensions.StackTrace.Sources.StackTraceHelper.GetFrames(Exception exception)\r\n   bei Microsoft.Extensions.StackTrace.Sources.ExceptionDetailsProvider.<GetDetails>d__3.MoveNext()\r\n   bei Hellang.Middleware.ProblemDetails.DeveloperProblemDetails.<GetErrors>d__4.MoveNext()\r\n   bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n   bei System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n   bei Hellang.Middleware.ProblemDetails.DeveloperProblemDetails..ctor(ExceptionProblemDetails problem, IEnumerable`1 details)\r\n   bei Hellang.Middleware.ProblemDetails.ProblemDetailsMiddleware.GetDetails(HttpContext context, Exception error)\r\n```\r\n\r\nI'm not sure how to reproduce it, but from reading the stack trace I have an idea what might happen:\r\n\r\nThe top methods of the exception call stack indicate that it crashes while reading a PDB file. The problem I see here is that that class name indicates that it tries to read a portable PDB. But my application is running ASP.NET Core 2.2 on the full .NET Framework 4.7.1 since some used libraries are not available as .NET Core or .NET Standard builds. Those libraries also use non-portable PDB files. So I assume the crash happens because it tries to read a non-portable PDB file assuming it is a portable one.\r\n\r\nI'm using ProblemDetails package version 3.1.0."},"comment":{"url":"https://api.github.com/repos/khellang/Middleware/issues/comments/536903276","html_url":"https://github.com/khellang/Middleware/issues/70#issuecomment-536903276","issue_url":"https://api.github.com/repos/khellang/Middleware/issues/70","id":536903276,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNjkwMzI3Ng==","user":{"login":"cremor","id":116314,"node_id":"MDQ6VXNlcjExNjMxNA==","avatar_url":"https://avatars1.githubusercontent.com/u/116314?v=4","gravatar_id":"","url":"https://api.github.com/users/cremor","html_url":"https://github.com/cremor","followers_url":"https://api.github.com/users/cremor/followers","following_url":"https://api.github.com/users/cremor/following{/other_user}","gists_url":"https://api.github.com/users/cremor/gists{/gist_id}","starred_url":"https://api.github.com/users/cremor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cremor/subscriptions","organizations_url":"https://api.github.com/users/cremor/orgs","repos_url":"https://api.github.com/users/cremor/repos","events_url":"https://api.github.com/users/cremor/events{/privacy}","received_events_url":"https://api.github.com/users/cremor/received_events","type":"User","site_admin":false},"created_at":"2019-10-01T07:16:30Z","updated_at":"2019-10-01T07:16:30Z","author_association":"NONE","body":"I've now created the issue: aspnet/AspNetCore#14609\r\n\r\nDid you already decide if you will also handle the exception in ProblemDetails?"}}
{"actor":{"display_login":"cremor"}}