Issue
We are using config transforms inside our solution. For example: Debug, Test, Staging, Release However, those configurations are only used on our MVC projects. all of the libraries only use Debug and Release, which makes more sense, because our libraries only need to be built in either debug mode, or release mode.
The issue arises when attempting to build a single project from the command line. I need to be able to do this in order to auto deploy our builds from TeamCity to our testing environment.
When I build the single project like this
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"
I get the following error
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.
I know what it means, because my sampleLibrary does not have a configuration for test, and the mapping for the sampleLibrary would be contained in my .sln file
Question
Is there a way to resolve this without having to add those configurations for every library project? It smells like an ugly hack here.
To build a specific target of a specific project in a solution. At the command line, type MSBuild.exe <SolutionName>. sln , where <SolutionName> corresponds to the file name of the solution that contains the target that you want to execute.
The Microsoft Build Engine is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software.
Would setting the switch/property /p:OutputPath=Test
work for you? It would output the dlls in a directory called Test (I guess you also could use TeamCity variables). Link to similar question/answer: https://stackoverflow.com/a/1083362/90033
Using the tfs online I got the same error, this fixed my problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With