我在使用 MSDeploy 和 Visual Studio 的发布配置文件时遇到了一个烦人的问题。在我的项目中,我有一个属性组,我设置了一个项目供以后引用。
<LocalBuildLocation>$(SolutionDir)WebSites\MyWebSite\</LocalBuildLocation>
不幸的是,Visual Studio 会随机删除此属性中的 $(SolutionDir)
字符串,我的构建将失败。我手动将其复制回去,一切正常。
谁能想到为什么这个项目不断地删除自己?
最佳答案
来自 MSDN: Using project properties in assembly and include directives
Visual Studio macros like
$(SolutionDir)
don’t work in MSBuild. You can use project properties instead.
使用 $(ProjectDir)
(更安全,项目级属性)或 $(MSBuildProjectDirectory)
(最安全,始终存在)
关于visual-studio - Visual Studio 发布 MSdeploy $(SolutionDir),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34930518/