Answered by:
Portable Class Library Build Errors

Question
-
I've tried adding some comments to this post (http://social.msdn.microsoft.com/Forums/en-US/909835f0-2ef0-4f64-836a-42f4a4d7d7dc/portable-class-library-build-warnings) and now creating a question due to lack of response.
I've got a standard .NET 4.5 C# class (Windows) library which has got a reference to C# portable library targeting .NET4.5, .NET for Windows store app, Silver light 5 and Phone 8 along with Microsoft BCL package. When I build this project on my local dev machine using VS2012, it all builds fine.
Problem we have got is the build server. We have TFS build agent which is set to build on every checkin and every time it fails with the error below. Surprising bit is if I logon to the build server using the same logon account as used by the TFS it builds. It is just the build agent which is failing.
All third party software and libs are installed on the build server.
Build output.
PrepareForBuild: Creating directory "obj\Release\". ResolveAssemblyReferences: A TargetFramework profile exclusion list will be generated. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" could not be resolved because it has an indirect dependency on the framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile158". To resolve this problem, either remove the reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" or retarget your application to a framework version which contains "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile158". To resolve this problem, either remove the reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" or retarget your application to a framework version which contains "System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" could not be resolved because it has an indirect dependency on the framework assembly "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile158". To resolve this problem, either remove the reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" or retarget your application to a framework version which contains "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile158". To resolve this problem, either remove the reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" or retarget your application to a framework version which contains "System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile158". To resolve this problem, either remove the reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" or retarget your application to a framework version which contains "System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile158". To resolve this problem, either remove the reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" or retarget your application to a framework version which contains "System.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj] C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile158". To resolve this problem, either remove the reference "C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Domain.Client.dll" or retarget your application to a framework version which contains "System.Runtime.Serialization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089". [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj] GenerateTargetFrameworkMonikerAttribute: Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files. CoreCompile: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /reference:C:\Builds\1\Newsys\Newsys\bin\Newsys\TimeRecording.Definitions.dll /reference:C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Definitions.dll /reference:C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.LinqConnect.dll /reference:C:\Builds\1\Newsys\Newsys\bin\Newsys\ToolBox.Portable.dll /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\Microsoft.Data.Edm.Portable.5.6.0\lib\portable-net4+sl5+wp8+win8\Microsoft.Data.Edm.Portable.dll /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\Microsoft.Data.OData.Portable.5.6.0\lib\portable-net40+sl5+wp8+win8\Microsoft.Data.OData.Portable.dll /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\Microsoft.Data.Services.Client.Portable.5.6.0\lib\portable-net45+sl5+wp8+win8\Microsoft.Data.Services.Client.Portable.dll /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\Microsoft.Bcl.Async.1.0.165\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.dll /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\Microsoft.Bcl.Async.1.0.165\lib\portable-net40+sl4+win8+wp71\Microsoft.Threading.Tasks.Extensions.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\mscorlib.dll" /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\Microsoft.Bcl.1.1.6\lib\portable-net40+sl5+win8+wp8\System.IO.dll /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\Microsoft.Bcl.1.1.6\lib\portable-net40+sl5+win8+wp8\System.Runtime.dll /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\System.Spatial.Portable.5.6.0\lib\portable-net40+sl5+wp8+win8\System.Spatial.Portable.dll /reference:C:\Builds\1\Newsys\Newsys\src\Newsys\packages\Microsoft.Bcl.1.1.6\lib\portable-net40+sl5+win8+wp8\System.Threading.Tasks.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.Net.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.Runtime.Serialization.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.ServiceModel.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.ServiceModel.Web.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.Windows.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.Xml.Linq.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile158\System.Xml.Serialization.dll" /debug:pdbonly /filealign:512 /keycontainer:VS_KEY_93DA41BBFC4AB1D0 /optimize+ /out:obj\Release\TimeRecording.Domain.Client.dll /target:library /utf8output Properties\AssemblyInfo.cs ..\SolutionInfo.cs Proxy\Activity.cs Proxy\BusinessUnit.cs Proxy\HandlingNote.cs Proxy\TimeRecord.cs Proxy\User.cs "Service References\Proxy\Reference.cs" Specification\CommonRefSpecification.cs UnitOfWork\TimeRecordingOnlinePersistenceSession.cs "C:\Users\TFS2012 User\AppData\Local\Temp\.NETPortable,Version=v4.0,Profile=Profile158.AssemblyAttributes.cs" Specification\CommonRefSpecification.cs(2,22): error CS0234: The type or namespace name 'Domain' does not exist in the namespace 'ToolBox' (are you missing an assembly reference?) [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj] Specification\CommonRefSpecification.cs(6,43): error CS0246: The type or namespace name 'SpecificationBase' could not be found (are you missing a using directive or an assembly reference?) [C:\Builds\1\Newsys\Newsys\src\Newsys\TimeRecording.Domain.Client\TimeRecording.Domain.Client.csproj]
Many thanks.Wednesday, November 27, 2013 10:01 AM
Answers
-
Hi,
I'd like to know the build process template you used and if you customized the template. What's the version of TFS and VS? You can try the following methods to see if this issue can be resolved:
1. If you customized build process template, please use a non-customized to have a try. Or use "AzureContinuousDeployment.11.xaml".
2. Check the settings of your build definition to see if all the items were configured correctly. Also check if the build service account has sufficient permission to access corresponding path of build agent machine. In property of build controller, see if the option "Run the Service Interactively" is checked.
3. Compare the build logs(CI build and build in agent machine directly) to see when this issue is occurred. Also check event viewer to see if there any useful info.
4. According to the error message, check whether your project has referenced wrong assemblies; Also make sure the needed libs are installed. You can refer to this thread for configuring an on-premise build controller. Also see this page for software on hosted build server.
5. Clean team foundation cache manually to have a try
- Clean the Cache folder on client computer. The folder path is: C:\Users\username(Team Explorer user name)\AppData\Local\Microsoft\Team Foundation\4.0\Cache. (os: Windows Server 2008 R2)
- Clean the Cache folder on Server machine. The folder path is: C:\ProgramData\Microsoft\Team Foundation\Web Access\Cache_v11.0. (os: Windows Server 2008 R2)
- After cleaned, on Server machine, click Start and select Run… to open the dialog box, then input iisreset.exe and click OK, wait it run completely.
If the issue still exist after taking actions mentioned above, please elaborate more details here.
Best regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- Edited by Charles-LiModerator Thursday, November 28, 2013 7:58 AM
- Proposed as answer by Charles-LiModerator Wednesday, December 4, 2013 1:34 AM
- Marked as answer by Charles-LiModerator Thursday, December 5, 2013 1:54 AM
Thursday, November 28, 2013 7:45 AMModerator