Content types : where are they used !

although working with content types is very pleaseant, there is one downside to it.

At least as fas as i have noticed.
That is when you try to change/delete a content type that is being used.
Still, no problem. But than you have to find out : where is it being used?
and that can be a pain in the …….

I decided to write some custom code to find these content types. Continue reading

Value cannot be null. Parameter name: serverContext

I’ve been working with servercontect several times.

Sometimes it worked, sometimes it didn’t.
I mostly use it with Userprofiles. I think most people already saw the followin code:

SPSite currentSite = SPContext.Current.Site;
ServerContext sc = ServerContext.GetContext(currentSite);
UserProfileManager upm = new UserProfileManager(sc);

whten using this code, the above error (value …, see title) could appear.
today was such a day. I took some code from virtual development environment (with the code aboce) and placed it in my realworld development environment.

Althought the code works on the virtual dev machine, it gave me the error i didn’t want to see.

So , what was the big difference between the two: the Shared service provider.
After implementing/configuring a shared service provider, the code also worked on my real world dev machine.

So somehow the servercontect object is (strongly) related to the shared service provider !

Hope this will help other develope

Document meta-data is stored with document

The meta-data you attache to a document is stored with that document.

what does that mean : the moment you move (non standard functionality) the document, all the metadata is moved with the document, and so, not lost.

Should you move the document back to the originating library, the metadata is shown as should be.

Moving itemsĀ  between document libraries : discussed here.