TeamCity MSBuild 4.0 Help

I need some help with my MSBuild file, which I created some time ago.

All I want to do is build a solution, publish the project inside the solution and copy the files to the directory

The moment I installed Teamcity for .net 4 msbuild, msbuild 4.0 tools and for 86, I get an error

error MSB4067: <ItemDefinitionGroup> element <Project> element is not recognized.


 <?xml version="1.0" encoding="utf-8" ?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Run"> <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/> <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"/> <PropertyGroup> <OutputFolder>$(OutputDir)</OutputFolder> <DeploymentFolder>$(DeploymentDir)</DeploymentFolder> <CompilationDebug /> <CustomErrorsMode /> <ContentEditorsEmail /> <AdministratorsEmail /> </PropertyGroup> <Target Name="Run"> <CallTarget Targets="Compile" /> <CallTarget Targets="Publish" /> <CallTarget Targets="Deploy" /> </Target> <Target Name="Clean"> <ItemGroup> <BinFiles Include="bin\*.*" /> </ItemGroup> <Delete Files="@(BinFiles)" /> </Target> <Target Name="Compile" DependsOnTargets="Clean"> <MSBuild Projects="WebCanvas.ZakisCatering.Website.sln" Properties="Configuration=Release"/> </Target> <Target Name="Publish"> <RemoveDir Directories="$(OutputFolder)" ContinueOnError="true" /> <MSBuild Projects="WebCanvas.ZakisCatering.Website\WebCanvas.ZakisCatering.Website.csproj" Targets="ResolveReferences;_CopyWebApplication" Properties="Configuration=Release;WebProjectOutputDir=$(OutputFolder);OutDir=$(WebProjectOutputDir)\" /> </Target> <Target Name="Deploy"> <RemoveDir Directories="$(DeploymentFolder)" ContinueOnError="true" /> <ItemGroup> <DeploymentFiles Include="$(OutputFolder)\**\*.*" /> </ItemGroup> <Copy SourceFiles="@(DeploymentFiles)" DestinationFolder="$(DeploymentFolder)\%(RecursiveDir)" /> </Target> </Project> 
+4
source share
2 answers

I am getting this error code too, although I'm complaining about another element:

Error MSB4067: The <ArtifactAssemblies> element <ItemGroup> element is not recognized.

I noticed that Teamcity invokes a version of MSBuild 2.0, which can explain why msbuild is struggling with xml.

'C: \ Windows \ Microsoft.NET \ Framework \ v2.0.50727 \ MSBuild.exe' @ "D: \ BuildAgent \ work \ 2f016459feee51ce \ Build \ BuildSolution.msbuild.teamcity.msbuild.tcargs" "D: \ BuildAgent \ work \ 2f016459feee51ce \ Build \ BuildSolution.msbuild.teamcity.patch.tcprojx "" working dir = 'D: \ BuildAgent \ work \ 2f016459feee51ce' Engine version of Microsoft (R) 2.0.50727.4016 [Microsoft.NET Framework, version 2.0.50727.400]

I fixed the msbuild 2.0 problem by adding a file. \ conf \ buildagent.properties on the city assembly agent machine, the following:

 env.MSBuild=%system.DotNetFramework4.0_x86_Path% 

Restart the service after that and fix the problem.

+8
source

Unfortunately, they do not package the goals of WebApplications. I can’t find an SDK that has these goals packaged without installing VS ... no. I do not understand why MS makes CI so complicated.

+1
source

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


All Articles