Note that there are some explanatory texts on larger screens.

plurals
  1. POMSBuild ReadLinesFromFile all text on one line
    text
    copied!<p>When I do a ReadLinesFromFile on a file in MSBUILD and go to output that file again, I get all the text on one line. All the Carriage returns and LineFeeds are stripped out.</p> <pre><code>&lt;Project DefaultTargets = "Deploy" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" &gt; &lt;Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/&gt; &lt;ItemGroup&gt; &lt;MyTextFile Include="$(ReleaseNotesDir)$(NewBuildNumber).txt"/&gt; &lt;/ItemGroup&gt; &lt;Target Name="ReadReleaseNotes"&gt; &lt;ReadLinesFromFile File="@(MyTextFile)" &gt; &lt;Output TaskParameter="Lines" ItemName="ReleaseNoteItems"/&gt; &lt;/ReadLinesFromFile&gt; &lt;/Target&gt; &lt;Target Name="MailUsers" DependsOnTargets="ReadReleaseNotes" &gt; &lt;Mail SmtpServer="$(MailServer)" To="$(MyEMail)" From="$(MyEMail)" Subject="Test Mail Task" Body="@(ReleaseNoteItems)" /&gt; &lt;/Target&gt; &lt;Target Name="Deploy"&gt; &lt;CallTarget Targets="MailUsers" /&gt; &lt;/Target&gt; &lt;/Project&gt; </code></pre> <p>I get the text from the file which normally looks like this</p> <blockquote> <pre><code>- New Deployment Tool for BLAH - Random other stuff()"" </code></pre> </blockquote> <p>Coming out like this</p> <blockquote> <pre><code>- New Deployment Tool for BLAH;- Random other stuff()"" </code></pre> </blockquote> <p>I know that the code for ReadLinesFromFile will pull the data in one line at a time and strip out the carriage returns.</p> <p>Is there a way to put them back in? So my e-mail looks all nicely formatted?</p> <p>Thanks </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload