Visual Studio 2005 以小写形式创建输出目录

发布于 2024-09-12 02:32:31 字数 606 浏览 9 评论 0原文

我使用的是标准操作环境,其中包括在 Windows XP 上运行的 Visual Studio 2005。

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

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

这给 Linux 中使用的对大小写很挑剔的源管理工具带来了问题。

有没有办法让 Visual Studio 2005 在正确的情况下创建目录?我考虑过使用调用 mkdir 的预构建脚本,因为我发现这可行,但必须为每个受影响的项目插入预构建脚本似乎很麻烦。

我还考虑过,也许是网络层导致了问题,但如果我临时将输出目录设置到本地硬盘驱动器,也会发生同样的情况。


更新一下,这里实际上有两个变量,$(TargetDir),它本质上只是 $(OutDir)$(OutputDir)< 的小写版本。 /code> 取决于构建阶段。我似乎不知道如何改变它,或者它来自哪里。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

脱离于你 2024-09-19 02:32:31

我只是通过在预构建步骤中使用 mkdir 来修复此问题。对于目录大小写很重要的每个项目,我有以下预构建步骤:

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

需要条件,因为如果目录已存在,则 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)"

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

甚是思念 2024-09-19 02:32:31

根据这篇文章,这是一个错误,但文章中指出了一个解决方法由微软。这篇文章是 2005 年的,所以我不确定它是否仍然是一个错误。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文