Skip to content

${aspnet-request-form} raises exception in ASP.NET Core #321

@mcliment

Description

@mcliment

Type (choose one):

  • Bug

NLog version: 4.5.10

NLog.Web/NLog.Web.AspNetCore version: 4.7.0

NLog.Extensions.Logging version:

Platform: .NET Core 2

Current NLog config (xml or C#, if relevant)

Not relevant, just add ${aspnet-request-form} to any target in the ASP.NET Core demo.

In case of a BUG:

  • What is the current result?

Raises an Invalid Operation Exception with message Incorrect Content-Type: .

  • What is the expected result?

To ignore requests that don't have posted form data.

Yes.

  • Please post full exception details (message, stacktrace, inner exceptions)

I provide a PR.

  • Are there any workarounds? yes/no

No that I know.

  • Is there a version in which it did work?

4.7.0 is the first to have this renderer.

  • Can you help us by writing an unit test?

Included in the following PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions