I tried to access the Default Termstore for a Sitecollection in order to create Groups and Termsets from a Farmsolution.
While accessing all existing MMS works perfect with:
TaxonomySession session = new TaxonomySession(web.Site);
I receive the correct amount (first 3, afterwards I tried to get other results with attaching just one MMS to the desired Sitecollection).
But every time I try to access the default Store with:
TermStore defaultTermStore = session.DefaultSiteCollectionTermStore;
all I get is "null" (used this part of the code example from MSDN)
The CA of my Sharepoint tells me that there really IS an default MMS for the desired Web-App.
What am I missing ?
EDIT: As L Sconyers pointed out, I need to set the default Proxy. Then I can find this Store in my code.
But my problem still exists. I have about 7 different TermStores in the Farm and each App has 1-3 of them assigned. Each App has one default Store defined in the wep applications / service connections (used for auto tagging and search applications). Is there any way to find this default Store for the App in which my feature is going to be activated?