Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

string.FastAllocateString, with Debug(x64), throws unhandled exception in mrt100_app.dll #8048

@knocte

Description

@knocte

Project using Microsoft.NETCore.UniversalWindowsPlatform 6.2.9, targetting Windows10 v1903 (10.0, build 18362).

I've narrowed it down to a call to deserialize this JSON string using Newtonsoft.JSON:

{"jsonrpc": "2.0", "result": ["ElectrumX 1.10.1", "1.4"], "id": 0}

The code:

JsonConvert.DeserializeObject<T>(json, PascalCase2LowerCasePlusUnderscoreConversionSettings)

With PascalCase2LowerCasePlusUnderscoreConversionSettings being:

JsonSerializerSettings(ContractResolver = PascalCase2LowercasePlusUnderscoreContractResolver())

where PascalCase2LowercasePlusUnderscoreContractResolver is:

type private PascalCase2LowercasePlusUnderscoreContractResolver() =
    inherit DefaultContractResolver()

    // https://stackoverflow.com/a/20952003/544947
    let pascalToUnderScoreRegex = Regex("((?<=.)[A-Z][a-zA-Z]*)|((?<=[a-zA-Z])\d+)", RegexOptions.Multiline)
    let pascalToUnderScoreReplacementExpression = "_$1$2"
    override __.ResolvePropertyName (propertyName: string) =
        pascalToUnderScoreRegex.Replace(propertyName, pascalToUnderScoreReplacementExpression).ToLower()

And T being this record:

type ServerVersionResult =
    {
        Id: int;
        Result: array<string>;
    }

Result where you can see the whole stacktrace (sorry, I didn't manage to copy it to clipboard, VS keep throwing at exception when attempting to do it):

Screenshot 2020-03-21 at 5 16 57 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions