<SchemaCatalog xmlns="http://schemas.microsoft.com/xsd/catalog"> <Schema href="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd" targetNamespace="http://schemas.microsoft.com/sharepoint/" /> </SchemaCatalog>
and copy this file to the following folder C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas\
class Program{ static void Main() { string sitePath = "http://litwareinc.com"; // enter object model through site collection. SPSite siteCollection = new SPSite(sitePath); // obtain reference to top-level site. SPWeb site = siteCollection.RootWeb; SPWeb site1 = site; //this actually create a copy of site, I will have followup blog on this after I find out how the assignment of an reference type got a copy instead of a pointer site1.Dispose(); //this does not affect site // enumerate through lists of site foreach (SPList list in site.Lists) { Console.WriteLine(list.Title); } // clean up by calling Dispose. site.Dispose(); siteCollection.RootWeb.Dispose(); siteCollection.Dispose(); }}
class Program{ static void Main() { string sitePath = "http://litwareinc.com"; // enter object model through site collection. SPSite siteCollection = new SPSite(sitePath); // obtain reference to top-level site. SPWeb site = siteCollection.RootWeb;
SPWeb site1 = site; //this actually create a copy of site, I will have followup blog on this after I find out how the assignment of an reference type got a copy instead of a pointer site1.Dispose(); //this does not affect site
// enumerate through lists of site foreach (SPList list in site.Lists) { Console.WriteLine(list.Title); } // clean up by calling Dispose. site.Dispose(); siteCollection.RootWeb.Dispose(); siteCollection.Dispose(); }}