Share

LinkedIn

MSBuild Errors in Team Development for Sitecore

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.
(NullReferenceException): at
HedgehogDevelopment.SitecoreProject.VSIP.SitecoreProjectNode.<get_CodeGenRefe
rencedProjects>b__1(BuildItem i)
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 5.0.0.23 (the current version as of this writing) with Visual Studio 2012. Hopefully this post saves someone time if they encounter similar issues.

Sitecore development, Sitecore custom code

Comments

Add a Comment

*
*

Please confirm you are human by typing the text you see in this image:

Vince (@SitecoreGeek) said: 3/2/2015 at 2:58 AM

Thanks, this happened to me today on just one project and decided to reinstall because of your post.. it helped!

Aware Web Solutions said: 3/3/2015 at 10:36 AM

Vince - glad we could help!

Clem said: 6/17/2015 at 6:52 AM

I'm using VS2013 with TDS 2013. Has this problem been resolved in this environment? Tried uninstalling and reinstalling. No luck.

Doug Yoder said: 6/18/2015 at 7:29 AM

Hi Clem,

This problem did get irritating enough that I contacted Hedgehog's support service. They recommended disabling Auto Code Generation and Background Cache in the TDS options (found in the Tools->Options screen). If that doesn't help you, you'll probably be best off contacting them as well, as it might be a different issue in VS2013. Good luck!

Nikola Gotsev(@nsgocev) said: 7/8/2015 at 3:21 AM

This might be caused by the evil .suo file. The usual resolution is - close the studio, delete the .suo file, reopen and try again :)

Douglas Couto said: 9/11/2015 at 9:28 AM

Re-installing TDS seemed to fix it for me. Thanks for the post!

Daniel said: 12/8/2015 at 2:23 AM

Thanks for info. Reinstalling TDS and restarting Visual Studio fixed the problem!

Mike LeVasseur said: 1/27/2016 at 11:35 AM

Just ran into this. Thanks for the blog!