本文介绍了如何把在VS2010后生成步骤双引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创造一个VS2010后生成的文件复制步骤,处理路径宏时,他们已嵌入空格。我试过在双引号周围的复制命​​令,但我得到的时候,如果 $(SolutionDir)包含空格副本调用错误。在错误信息回显命令行不显示双引号。

I'm trying to create a post build file copy step in VS2010 which handles path macros when they have embedded spaces. I've tried surrounding the copy commands in double quotes but I get error from when copy is invoked if $(SolutionDir) contains a space. the echoed command line in the error message does not show the double quotes.

复制$(SolutionDir)$(配置)\\ *,$(TARGETDIR)

我也分开审讯 \\但是这两个导致2个字符转义序列出现在呼应命令行?一个人如何正确转义双引号在构建步骤?

I also tried separately \" and "" but both of these cause the 2 character escape sequence to appear in the echoed command line? How does one properly escape a double quote in a build step?

推荐答案

我是用双引号在Visual Studio中的pre-生成事件命令遇到了麻烦。我见过的批处理文件,解决这个问题,但它似乎是一个批处理文件,也不会解决所有问题,而不是优雅。的我找到了解决办法是关闭双引号之前放一个空格。的具体情况如下:

I was having trouble using double quotes with a pre-build event command in Visual Studio. I have seen the batch file solutions to this problem, but it seems a batch file would not solve all problems and is not elegant. I found the solution was to put a space before the closing double quote. The details are as follows.

下面的命令工作,但不会支持在路径中有空格:

The following command worked, but would not support spaces in the path:

subwcrev $(SolutionDir)$(SolutionDir)subwcrev_template.txt $(SolutionDir)version.h中

我有过在其他开发商将解决方案置于无法控制的,所以我必须支持在路径中有空格。试图用引号括住路径支持位,我想出了下面的命令。它总是失败。

I have little control over where other developers will place the solution, so I had to support spaces in the path. Trying to use quotes around paths to support spaces, I came up with the following command. It always fails.

subwcrev$(SolutionDir)$(SolutionDir)subwcrev_template.txt$(SolutionDir)version.h中

几乎是偶然,我找到了解决办法,把路径的最后一个字符和双引号之间的空间。

Almost by accident, I found the solution, put a space between the last character of the path and the double quote.

subwcrev$(SolutionDir)$(SolutionDir)subwcrev_template.txt$(SolutionDir)version.h中

这工作。我在AVR Studio中6.1,它使用一个Visual Studio壳牌测试这一点。

This worked. I tested this in AVR Studio 6.1, which uses a Visual Studio Shell.

这篇关于如何把在VS2010后生成步骤双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 07:14