I’ve recently faced an issue connecting TaxonomyFields to the correct termset/group on a new farm.
The same code – the feature receiver that was connecting the fields to the termsets – was working on other environments, so it could only be something related to the environment.
I created a small console application, with lots of tracing messages, and I came to the conclusion that when picking the termstores from the taxonomy session, those were always null (event the default one).
After doing some research I finally found that the Managed Metadata Service Application proxy needs to be part of the default proxy group…
All it takes is to add it to the default proxy group using powershell:
Set-SPMetadataServiceApplicationProxy -Identity “name of your MMS proxy” -DefaultProxyGroup
And that’s it, your code shoud now find the termstores normally.
Cheers!