Get helpful tips on avoiding errors when working on TDS projects in Visual Studio.
Recently, I ran into some strange errors working with a TDS project in Visual Studio. I had been working on one branch of a Git repository, then changed branches. The next time I tried to either build or “Sync With Sitecore”, I got errors similar to the following:
Object reference not set to an instance of an object.
Microsoft.Build.BuildEngine.Shared.InternalErrorException: Internal MSBuild
Error: We can only call this method once
My colleagues working on the same project did not have any problems on their PCs.
Google wasn’t much help with those errors. The best I could get was that it was probably something to do with invalid project references. I tried looking for missing references, and double-checked the project dependencies for the TDS projects, to no avail.
I tried the usual suspects – restart Visual Studio, then restart the PC, but the problem still persisted. Finally, I ran the TDS installer using the “repair” option, and the errors disappeared.
The problems occurred on TDS version 22.214.171.124 (the current version as of this writing) with Visual Studio 2012. Hopefully this post saves someone time if they encounter similar issues.