Why does rebuilding an SDL Trados Studio API based Project in Visual Studio cause certain dependencies to be lost?

Why does rebuilding an SDL Trados Studio API based Project in Visual Studio cause certain dependencies to be lost?

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Sdl.ProjectApi.dll

Additional information: Could not load file or assembly 'Sdl.Terminology.TerminologyProvider.Core, Version=12.0.0.0, Culture=neutral, PublicKeyToken=c28cdb26c445c888' or one of its dependencies. The system cannot find the file specified.

This error occured after rebuilding a project which requires dependencies from Trados such as

Assembly Sdl.ProjectApi
C:\Program Files (x86)\SDL\SDL Trados Studio\Studio4\Sdl.ProjectApi.dll

which is found in the object browser.

The error occurs on the line

FileBasedProject trados_project = new FileBasedProject(this.GetInfoForTemplateProject(localProjectFolder), template);

Before rebuilding the project, it was running properly.

at Sdl.ProjectApi.Implementation.Factory.CreateApplication()
at Sdl.ProjectApi.ApplicationFactory.CreateApplication()
at Sdl.ProjectAutomation.FileBased.ProjectAutomationContext.GetProjectServer(ProjectCredentials projectCredentials)
at Sdl.ProjectAutomation.FileBased.FileBasedProject..ctor(ProjectInfo projectInfo, ProjectTemplateReference templateReference)
at AutomatePreTranslate.PreTranslatorMFL.CreateBasedOnTemplate(String localProjectFolder) in c:\Program Files (x86)\SDL\SDL Trados Studio\Studio4\PreTranslatorMFL.cs:line 62
at AutomatePreTranslate.PreTranslatorMFL.Create(String toBeTranslatedFolder, String tmFile, Boolean recursion, Boolean reportCrossFileRepetitions, Boolean reportInternalFuzzyMatchLeverage, Boolean keepProjectFiles, AutomateSettings s) in c:\Program Files (x86)\SDL\SDL Trados Studio\Studio4\PreTranslatorMFL.cs:line 125
at AutomatePreTranslate.PreTranslatorMFL.Create(AutomateSettings s) in c:\Program Files (x86)\SDL\SDL Trados Studio\Studio4\PreTranslatorMFL.cs:line 28
at AutomatePreTranslate.Initialize.executePreTranslate(AutomateSettings s) in c:\Program Files (x86)\SDL\SDL Trados Studio\Studio4\Initialize.cs:line 57
at AutomatePreTranslate.Initialize.Main(String[] args) in c:\Program Files (x86)\SDL\SDL Trados Studio\Studio4\Initialize.cs:line 48
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()