Web サービスを使用して SharePoint 2010 リストを更新しようとしています。私のコードは、ROOT レベル (またはサイト コレクション レベル) のリストを正常に更新できます。アプリケーションが「ここで参照されているリストはもう存在しません。」というエラーをスローするのは、バリエーション レベルでリストを更新しようとしたときだけです。list.url プロパティを設定しようとしたことに注意してください。手動で更新された app.config。もっとアイデアを共有してください。私のコード:
try
{
System.Xml.XmlNode ndListView = list.GetListAndView("{GUID}", "");
string strListID = ndListView.ChildNodes[0].Attributes["Name"].Value;
string strViewID = ndListView.ChildNodes[1].Attributes["Name"].Value;
XmlElement xmlBatchElement = xmlDoc.CreateElement("Batch");
xmlBatchElement.SetAttribute("ListVersion", "1");
xmlBatchElement.SetAttribute("OnError", "continue");
xmlBatchElement.SetAttribute("ViewName", strViewID);
xmlBatchElement.InnerXml = TheCaml; // TheCaml holds XML updates.
try
{
XmlNode xmlReturn = list.UpdateListItems(strListID, xmlBatchElement);
// UpdateListItems は、リストがもう存在しないというエラーを返します。