Visual Studio 2005以小写形式创建输出目录 [英] Visual Studio 2005 creates output directories in lowercase

查看:69
本文介绍了Visual Studio 2005以小写形式创建输出目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的标准操作环境涉及在Windows XP上运行的Visual Studio 2005。

I am using a standard operating environment which involves Visual Studio 2005 running on Windows XP.

该解决方案的源代码在Linux中进行管理,但使用通过网络共享在Windows计算机上的Visual Studio。

The source for the solution is managed in Linux, but edited and compiled using Visual Studio on a Windows computer via a network share.

我面临的问题是,如果更改解决方案中某些项目的输出目录,Visual Studio会自动创建目录,但它们总是小写。输出文件的大小写正确,只有目录为小写。

The problem I am facing is that if I change the output directory of certain projects of my solution, Visual Studio automatically creates the directories but they are always in lowercase. The output files have the correct case, only the directories are in lowercase.

这会导致Linux中使用的源管理工具出现大小写问题。

This is causing problems for the source management tools that are used in Linux which are picky about case.

有什么方法可以使Visual Studio 2005在正确的情况下创建目录?我已经考虑过使用调用 mkdir 的预构建脚本,因为我发现这可行,但是为每个受影响的项目插入预构建脚本似乎很麻烦

Is there any way to get Visual Studio 2005 to create directories in the right case? I have considered using a pre-build script that calls mkdir, since I've found this works, but it seems cumbersome to have to insert pre-build scripts for each affected project.

我也考虑过可能是网络层引起了问题,但是如果我将输出目录临时设置到本地硬盘上,也会发生同样的情况。

I have also considered that perhaps it is the network layer that is causing the problems, but if I temporarily set output directories to the local hard drive the same thing happens.

实际上,这里有两个变量, $(TargetDir),实际上只是 $(OutDir) $(OutputDir)的小写版本建立阶段。我只是似乎不知道如何更改它或它的来源。

To update, there are actually two variables here, $(TargetDir), which is essentially just a lowercase version of $(OutDir) or $(OutputDir) depending on the build stage. I just can't seem to find out how to change it, or where it comes from.

推荐答案

我只是通过以下方式解决了该问题在预构建步骤中使用 mkdir 。对于每个目录的大小写都很重要的项目,我需要执行以下预构建步骤:

I fixed this just by resorting to using mkdir in a pre-build step. For each project where the case of the directory is important, I have the following pre-build step:

if not exist "$(OutputDir)" mkdir "$(OutputDir)"

该条件是必需的,因为 mkdir 如果目录已经存在,则返回非零,这将停止构建。

The conditional is required because mkdir returns non-zero if the directory already exists, and this stops the build.

这篇关于Visual Studio 2005以小写形式创建输出目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆