Omicron Llama

Coding all day, every day.

No Content Types or Site Columns when creating Site Collection from code

Had a quick frustration today, that some code I had (bog standard SPWebApplication.Sites.Add) would create a site collection fine but had absolutely no content types or site columns. Both galleries were empty.

Lists and Libraries had content types (such as Pages) fine, but SFA in the gallery.

If you have this, you’re probably doing what I’m trying to do: constantly tear down and rebuild stuff in an automated manner for testing.

What you need to do is to do an

in between teardown and rebuild of the site collection.

Not sure why this is, something in the object model cache must be getting stuck, but I didn’t see anything in the ULS logs as a clue.

Oh, and also: I’m keeping this blog theme. It’s getting good feedback 😛

Leave a Reply

Your email address will not be published. Required fields are marked *