"OutputPath property not set" error occurs only when MSBuild is called in CCNET

I created an MSBuild project that just does the msbuild task with our solution file as a parameter. I defined the BeforeBuild target, where I set some properties, and the assembly object that performs the msbuild task.

I confirmed that there were no errors when creating the msbuild script in the command line console. However, when I use it in the msbuild task in my CCNET project, I keep getting the following error:

C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.Common.targets (483.9): error: OutputPath property not set for the project 'MyProject.msbuild. Please check to make sure you provide a valid combination of Configuration and Platform for this project. Configuration = "debugging" Platform = 'AnyCPU. You can see this message because you are trying to build a project without solving the file, and you specified a non-standard configuration or platform that does not exist for this project.

I checked the build log and it seems like an error occurs during _CheckForInvalidConfigurationAndPlatform. He could not even continue my build task! Since the script is intended only for building the solution under Debug / Release and AnyCPU as a platform, I tried to add the following lines to my msbuild project:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <OutputPath>.\bin\Debug\</OutputPath> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <OutputPath>.\bin\Release\</OutputPath> </PropertyGroup> 

I could still build the project without errors on the command line, but CCNET returns the same error that was mentioned above.

I do not understand why CCNET continues to receive the error, and I do not know what else to try.

Please, help.

+4
source share
2 answers

I found that I had a similar situation (but using TeamCity as a CI environment). In my particular case, the project was a command line application. To solve this problem, I had to manually edit the project file.

Find the following lines:

 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">x86</Platform> 

Change the second line to:

 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 

Find other platform-related strings in the project file and modify them. Example:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> 

becomes:

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> 

My suspicion is that our build servers are 64-bit, and the Console Application project type in Studio will not allow you to make the project suitable for the AnyCPU platform ...

After these changes, TeamCity had no problems with my build script.

+10
source

A response from David helped me. But later I found the actual source of the problem for my computer. The PLATFORM environment variable is added on HP machines and affects a number of different scenarios with Visual Studio.

Go to environment variables-> System variables and remove "PLATFORM" from the list.

See here for more details: http://blogs.msdn.com/b/jnak/archive/2010/03/24/outputpath-property-is-not-set-for-project-error-when-building-a-windows -azure-cloud-service-in-vs-2010.aspx

+3
source

Source: https://habr.com/ru/post/1311713/


All Articles