TeamCity And NUnity Build issue

Recently, in a project upgrade task I faced an issue on Team City, the code was perfectly building on my local but failing on Team City

error CS0012: The type ‘System.IDisposable’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’.

Conditions:

  • Microsoft .NET Framework 4.5.2
  • Unity Project

After some attempts, nothing solved, the solution was the installation of “Microsoft .NET Framework 4.5.2 Developer Pack” on Team City servers

Link : https://support.microsoft.com/en-us/help/2971005/error-message-when-you-compile-applications-to-target-the-.net-framework-4.5.2

Note: If the installation occurs on a Windows 2008, the machine needs to be rebooted, but If the installation occurs in a Windows 2012, the reboot is not necessary. I would like to thank Vinicius Deschamps for this note