visual-studio - Visual Studio 发布 MSdeploy $(SolutionDir)

标签 visual-studio msbuild publish msdeploy

我在使用 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/

相关文章:

visual-studio - 使用 MbUnit/Gallio 3.1 进行调试

Git - 子模块脏 - Visual Studio 项目文件

c# - 没有 "Task attempted to log before it was initialized"错误的单元测试 MSBuild 自定义任务

azure - 使用代码在 Azure Synapse 上发布按钮

publish - 将 Bintray 上的公共(public) Github 存储库链接到 JCenter

c++ - 如何修复Visual Studio Project寻找不存在的头文件?

sql-server - 错误 : the timestamp signature and/or certificate could not be verified or is malformed

visual-studio - ##[警告]未找到 Visual Studio 版本 '14.0'。回退到版本 '15.0'

msbuild - GAC 中的程序集未复制到引用项目的输出中,该项目引用了使用 CopyLocal=true 的 GAC 程序集

sql-server - 找不到文件 dacpac?