开发者

Visual Studio 2005 creates output directories in lowercase

I am using a standard operating environment which 开发者_运维技巧involves Visual Studio 2005 running on Windows XP.

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

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.

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

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.


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.


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)"

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


According to this article, this is a bug, but there is a workaround pointed out in the article by Microsoft. The article is from 2005, so I am not sure if it is still a bug.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜