Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I found this documentation which goes over how to add a list, but it doesn't seem possible to specify a GUID if you use this method.

Is there any way to create a list and specify the GUID? I am trying to recreate several lists on a different server and if they do not have the same GUIDs other functionality may break.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Sadly, you can't. You probably make it work by using the title of the list to get its instance instead of its internal GUID.

share|improve this answer
    
@Abe Miessler @Sébastien Levert, I think it is better to use url of the list's AllItems.aspx page, and use SPWeb.GetListFromUrl, because list Title can be easily changed by user through the GUI. –  Andrey Markeev May 19 '11 at 4:31
    
You are right. In fact, I'm using a custom extension methods that allow me to get a list instance from its RootFolder name. So it is by its URL that I'm getting it. Working in a bilingual environment (French and English), I can't refer to a list name, because they usually have 2 of them. –  Sébastien Levert May 19 '11 at 11:58

Unfortunately, it is not possible to assign your own GUID when you create a list.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.