MSBuild - 我可以在没有解决方案的情况下构建构建配置吗?
MSBuild - Can I build for a Build Configuration without a solution?
我想构建一个具有特定命名构建配置的项目,我们称之为 Conf-A。
这是 运行 作为 TeamCity 上的 MSBuild 步骤。当构建运行时,它吐出:
The OutputPath property is not set for project ... You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.
这个项目是我们在开发机器上加载的庞大解决方案的一部分。
这个错误对我的情况有意义,因为我只是构建 proj 文件,但我不想使用解决方案文件,因为我正在尝试分解这个单一的应用程序。
我希望构建服务器将此项目视为它自己的组件,即使目前它是解决方案的一部分并且引用了解决方案中的其他项目(程序集)。
我必须通过解决方案文件构建它吗?
我可能会复制解决方案文件并删掉所有其他不需要的项目,但这更复杂。
(也许错误是转移注意力)。
您不需要构建 sln。就像错误所说的那样。您只是没有在 msbuild 中为变量 OutputPath 指定一个值。您可以将它添加到您的文件中,也可以在 cmd 行中传递它 - msbuild someproj.proj /p:OutputPath=C:\notallovermydrive
我想构建一个具有特定命名构建配置的项目,我们称之为 Conf-A。
这是 运行 作为 TeamCity 上的 MSBuild 步骤。当构建运行时,它吐出:
The OutputPath property is not set for project ... You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.
这个项目是我们在开发机器上加载的庞大解决方案的一部分。
这个错误对我的情况有意义,因为我只是构建 proj 文件,但我不想使用解决方案文件,因为我正在尝试分解这个单一的应用程序。
我希望构建服务器将此项目视为它自己的组件,即使目前它是解决方案的一部分并且引用了解决方案中的其他项目(程序集)。
我必须通过解决方案文件构建它吗?
我可能会复制解决方案文件并删掉所有其他不需要的项目,但这更复杂。
(也许错误是转移注意力)。
您不需要构建 sln。就像错误所说的那样。您只是没有在 msbuild 中为变量 OutputPath 指定一个值。您可以将它添加到您的文件中,也可以在 cmd 行中传递它 - msbuild someproj.proj /p:OutputPath=C:\notallovermydrive