Skip to content
This repository was archived by the owner on Feb 27, 2021. It is now read-only.

Escaped characters producing unexpected results #17

@brinko99

Description

@brinko99

I find that with certain XML escaped characters existing in my App.config, the transform results in the unescaped character in the resulting exe.config file. Find an example repo project here.

For example, this line in App.config:
<variable name="exceptionHeader" value="${newline}${newline}Exception Detail&#xFF1A;${newline}" />

Results in this line within the exe.config:
<variable name="exceptionHeader" value="${newline}${newline}Exception Detail:${newline}" />

Note the conversion of &#xFF1A; to :.

This results in errors when trying to parse the data from the exe.config. The above is an example of an NLog configuration. NLog has issues with colons (apparently even the fixed width colon), the escaped values are necessary.

Additionally newlines within an attribute are stripped. For example:

<variable name="exceptionDetail"
          value="${exception: format=${exceptionFormat}: separator=&#xD;&#xA;: innerFormat=${exceptionFormat}:
                              innerExceptionSeparator=&#xD;&#xA;&#xD;&#xA;Inner Exception&#xFF1A;&#xD;&#xA;}" />

becomes:

<variable name="exceptionDetail"
          value="${exception: format=${exceptionFormat}: separator=&#xD;&#xA;: innerFormat=${exceptionFormat}:&#xD;&#xA;                                  innerExceptionSeparator=&#xD;&#xA;&#xD;&#xA;Inner Exception:&#xD;&#xA;}" />

Note the newline disappears.

Any help in this area is appreciated. Great tool; keep up the good work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions