Issue Building Project using MSBuild xBuild runner

Hi,

Using the MSBuild xBuild runner I get the following issue where it cannot find the .net 3.5 assemblies, if I run xbuild manually on either the .sln or the generated .sln by teamcity it builds fine,
what is teamcity doing that I am not to make it not work.


[16:52:00]: Project started.
[16:52:01]: [Project started.] Project started.
[16:52:01]: [Project started.] Project started.
[16:52:01]: [Project started.] /usr/local/lib/mono/2.0/Microsoft.Common.targets Error executing task ResolveAssemblyReference: Cannot resolve dependency to assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
[16:52:01]: MSBuild output:
[16:52:01]: Done building project "/home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.Core/YetAnotherUtilsLib.Core.csproj".-- FAILED
[16:52:01]:
[16:52:01]: Task "MSBuild" execution -- FAILED
[16:52:01]: Done building target "Build" in project "/home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.sln".-- FAILED
[16:52:01]:
[16:52:01]: Done building project "/home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.sln".-- FAILED
[16:52:01]:
[16:52:01]: Task "MSBuild" execution -- FAILED
[16:52:01]: Done building target "TeamCity_Generated_Build" in project "/home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.sln.teamcity.patch.tcprojx".-- FAILED
[16:52:01]: Done building project "/home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.sln.teamcity.patch.tcprojx".-- FAILED
[16:52:01]: Build FAILED.
[16:52:01]: Errors:
[16:52:01]: /home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.sln.teamcity.patch.tcprojx (TeamCity_Generated_Build) ->
[16:52:01]: (TeamCity_Generated_Build target) ->
[16:52:01]: /home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.sln (default targets) ->
[16:52:01]: (Build target) ->
[16:52:01]: /home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.Core/YetAnotherUtilsLib.Core.csproj (default targets) ->
[16:52:01]: (ResolveAssemblyReferences target) ->
[16:52:01]: /usr/local/lib/mono/2.0/Microsoft.Common.targets: error : Error executing task ResolveAssemblyReference: Cannot resolve dependency to assembly 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
[16:52:01]: 0 Warning(s)
[16:52:01]: 1 Error(s)
[16:52:01]: Time Elapsed 00:00:00.4702070
[16:52:01]: Build finished



Cheers
Stefan
3 comments

By the way am running 64bit Ubuntu 10.04 with mono 2.6.3.


Thanks

0

After more investigation I found that if I remove the line:

"/logger:JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger,/home/vps/TeamCity/buildAgent/plugins/dotnetPlugin/bin/JetBrains.BuildServer.MSBuildLoggers.dll"


From the .teamcity.msbuild.tcargs file and run the build command like TeamCity:

'/usr/local/bin/mono' /usr/local/lib/mono/2.0/xbuild.exe "@/home/vps/TeamCity/buildAgent/work/6a18d45698b6018e/src/YetAnotherUtilsLib.Core/YetAnotherUtilsLib.Core.csproj.teamcity.msbuild.tcargs" src/YetAnotherUtilsLib.Core/YetAnotherUtilsLib.Core.csproj


It will build, but add that line back in and it fails, so narrowed it down to this.
0

Please sign in to leave a comment.