Issue
我们在解决方案中使用配置转换。例如:调试、测试、登台、发布
但是,这些配置仅用于我们的 MVC 项目。所有的库只使用调试和发布,这更有意义,因为我们的库只需要在调试模式或发布模式下构建。
尝试从命令行构建单个项目时会出现此问题。我需要能够执行此操作,以便将我们的构建从 TeamCity 自动部署到我们的测试环境。
当我像这样构建单个项目时
msbuild myproject.csproj
/t:Build
/P:Configuration=Test
/P:Platform=AnyCPU
/P:DeployOnBuild=True
/P:DeployTarget=MSDeployPublish
/P:MsDeployServiceUrl=https://SERVER:8172/MsDeploy.axd
/P:AllowUntrustedCertificate=True
/P:MSDeployPublishMethod=WMSvc
/P:CreatePackageOnPublish=True
/P:UserName=Username
/P:Password=Passsword
/P:DeployIisAppPath="IISAPPPATH"
我收到以下错误
myproject.csproj" (Build target) (1) ->
"C:\src\myproject.csproj" (default target) (18) ->
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(483,9)
: error : The OutputPath property is not set for project 'sampleLibrary.csproj'.
Please check to make sure that you have specified a valid combination of
Configuration and Platform for this project. Configuration='Test'
Platform='AnyCPU'. 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.
我知道这意味着什么,因为我的 SampleLibrary 没有用于测试的配置,并且 SampleLibrary 的映射将包含在我的 .sln 文件中
Question
有没有办法解决这个问题,而不必为每个库项目添加这些配置?这里闻起来像一个丑陋的黑客。
将设置开关/属性/p:OutputPath=Test
为你工作?它将在名为 Test 的目录中输出 dll(我猜您也可以使用 TeamCity 变量)。
类似问题/答案的链接:https://stackoverflow.com/a/1083362/90033 https://stackoverflow.com/a/1083362/90033
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)