在 vcproj 文件中获取 $(ProjectDir), $(SolutionDir) 的值 [英] getting the value of $(ProjectDir), $(SolutionDir) in a vcproj file

查看:39
本文介绍了在 vcproj 文件中获取 $(ProjectDir), $(SolutionDir) 的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Visual Studio 之外以编程方式获取 $(ProjectDir)$(SolutionDir) 的值?我的情况是我需要将 vcproj 文件作为文本文件读取并获取其属性,如输出目录等.问题是某些属性包含环境变量,如 $(SolutionDir) 等.

Is it possible to get the value of $(ProjectDir) or $(SolutionDir) programatically outside Visual Studio? My scenario is I need to read a vcproj file as a text file and get its properties like the outputdirectory etc.. problem is some properties contain environment variables like $(SolutionDir) and the like.

推荐答案

好吧,您发现查看 .vcproj 文件是不够的.您还需要知道 .sln 文件.在你解决这个问题之前,你有点卡住了.当 Visual Studio 加载 .vcproj 文件并且找不到匹配的 .sln 时,它总是会创建一个 .sln 文件.也许你也想这样做.

Well, you found out that looking at the .vcproj file isn't enough. You need to know the .sln file as well. You're kinda stuck until you resolve this. Visual Studio will always create a .sln file when it loads a .vcproj file and cannot find a matching .sln. Maybe you want to do that too.

这篇关于在 vcproj 文件中获取 $(ProjectDir), $(SolutionDir) 的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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