I am currently working on a small console application which takes in a path name via the Command Line Parameters, parses the given path, and produces an XML file listing each folder and file.

I am running the application as a Post Build event in Visual Studio, passing in the $(TargetDir) macro as;

"c:Program FilesCreateUpdateXMLCreateUpdateXML.exe" "$(TargetDir)"

You’ll notice the extra trailing backslash after the Macro.

“Visual studio already adds a trailing backslash though!”

Yes… You’re right… However, a trailing backslash followed by quotation marks is converted to an Escape by Windows.

To work around this issue, you must escape the backslash, forcing windows to use it. This is achieved by simply adding another backslash to the path.

By | 2012-09-25T11:23:00+00:00 September 25th, 2012|Bugs, File Access, VB.net, Visual Studio|0 Comments

About the Author:

Leave A Comment