New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSBuild property values should escape carriage return and line feed #1910

Closed
jnm2 opened this Issue Nov 4, 2017 · 0 comments

Comments

Projects
None yet
3 participants
@jnm2
Contributor

jnm2 commented Nov 4, 2017

Without escaping these, there's no way to set a multiline property value such as PackageReleaseNotes for the MSBuild Pack target.

I saw that you're doing URL encoding when semicolons are present and indeed, the same trick works for CRLF:

var releaseNotes = ParseReleaseNotes("./ReleaseNotes.md").Notes;

MSBuild(BuildParameters.ProjectDir, new MSBuildSettings()
    .WithTarget("Pack")
    .WithProperty("PackageReleaseNotes", string.Join("%0D%0A", releaseNotes)));

However, I shouldn't be URL-encoding myself- what if one of the lines contains a semicolon? Then it probably gets URL-encoded again by Cake, breaking the manually-URL-encoded newlines.

We should be able to do .WithProperty("PackageReleaseNotes", string.Join("\r\n", releaseNotes)) and have automatic URL-encoding just like we get for semicolons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment