Sooner or later, you might run into this error.  I was able to work out the easy solution so I wanted to share it to help someone else.  You will likely run into this error if you try to go site column or site content types, or from a list or library you click add site column. In my case, I had just created a site from a custom site template and was getting this error.  Let’s dig in.

By default the error won’t be visible and you will only get the dreaded Server Error / Exception message.  To see if you truly getting this error, you will need to enable debug logging to see the error.  This is well documented so I won’t rehash here, but here’s the steps.  You can also check the ULS logs (you might have to set verbose logging).  With logging enabled, you see this in the interface:

image

System.ArgumentException: No two choices should have the same ID

I was lucky in that I could still get to site columns, just not add site column from a library.  Looking at the site columns, I saw one custom column that somehow had gotten duplicated.  Once I had deleted the duplicate site column, I was able to add site columns without an issue.  I love easy fixes.  Now if you can’t get to site columns through the interface, you can use PowerShell as well.  Basically just get the site collection object (get-spsite) then the rootweb ($web = $site.rootweb), then return the fields using $web.fields. 

Hope it helps someone!

For more information on C5 Insight or this blog entry, please Contact Us.