Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange XML modification when input and output it in console app using Visual Studio
    primarykey
    data
    text
    <p>I have a simple console app that was creted in c# using VisualStudio. It has a input parameter and return it to output. This is the code:</p> <pre><code> static void Main(string[] args) { string msg = args[0]; Console.WriteLine(msg); } </code></pre> <p>Then I try to pass a param that contain a xml as string: <code>"&lt;messages&gt;&lt;message&gt;message&lt;/message&gt;&lt;/messages&gt;"</code>. There is nothing wrong if I will use console for calling application. But in the case when I trying to debug such application I have added parameter string to <em>Command line arguments</em> on the <em>Debug</em> tab.</p> <p><img src="https://i.stack.imgur.com/G0iYQ.png" alt="alt text"> After this I have got unexpected output like: </p> <pre><code> ^&lt;messages^&gt;^&lt;message^&gt;message^&lt;/message^&gt;^&lt;/messages^&gt; </code></pre> <p>Why we have such output and how to overcome this? Thanks in advance.</p> <hr> <p>The simplest solution for this issue should be replacing unwilling characters like here:</p> <p>static void Main(string[] args) { string msg = args[0];<br> Console.WriteLine(msg.Replace("^",""); }</p> <p>But the reason of such behavior placed somewhere in the core of the operation system. Windows handle this situation like launch a batch file from command line with parameters. Following the link that was presented in the answer of @Artem K. you can find out that here is two way to overcome such situation. Unfortunately, no one work with this issue. Possible, because Visual Studio add something from yourself in the question how to pass args for launching batch.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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