A member of the Microsoft.SharePoint namespace, SPSite represents a collection of sites in a Web application, including a top-level Web site and all its subsites. Each SPSite object, or site collection, is represented within an SPSiteCollection object that consists of the collection of all site ...

learn more… | top users | synonyms

0
votes
1answer
36 views

Maximum length of SPSite Name and Description property values

Is there any reference to the maximum size for the Name and Description properties of a site collection?
4
votes
1answer
74 views

Setting an SPSite to read-only from Application Page

We are trying to make a site read-only from the code-behind of an application page. When executing the code-snippet from a timer job or a console application it works perfectly, but it throws an ...
0
votes
0answers
61 views

SPSite.Usage.Storage seems incorrect for some SCs

I am seeing weird results from getting the Usage.Storage data from some site collections. For one site in particular it is returning 0.04GB. A subsite within this site collection is returning 2.56GB. ...
0
votes
0answers
34 views

Cannot connect to my SPSite

I'm facing a strange issue. I have a console application project and added assembly Microsoft.SharePoint from C:\Program Files\Common Files\Microsoft Shared\Web Server ...
0
votes
1answer
175 views

Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime

I am developing a windows service in C# and adding dll for SharePoint. I have added reference from C:\Program Files\Common Files\Microsoft Shared\Web Server ...
3
votes
2answers
402 views

Get SPWeb at all the levels

I have a root site with sites at different levels(depth is unknown). How can I find all the SPWeb objects iterating till the deepest level. will the below code give me desired result ...
0
votes
1answer
152 views

Error while restoring Site Collection to the same server

I am trying to restore a site (http://server:7457) to another site (http://server:80) on the same server. I had took the backup of the first site using SharePoint Administration Central. When I ...
0
votes
0answers
38 views

search mutliple sites get-SPsite

I have a site mysite which also has other site collections which are not shown if you just do Get-SPSite is there anyway to search multiple site using Get-SPSite I know this doesn't work but for ...
0
votes
2answers
2k views

What is difference between SPContext.Current.Web.URL and SPContext.Current.Site when using SPSite object?

SPSite spsite1=new SPSite(SPContext.Current.Web.URL); SPSite spsite2=SPContext.Current.Site; What is the difference and when do we decide which one to use? I feel both give us the site collection ...
0
votes
4answers
130 views

SPSite URL value

Hello I am trying to fetch a list item and want to know if this is a good practice. SPSite spsite = new SPSite(SPContext.Current.Web.Url); SPWeb spWeb = spsite.RootWeb; ...
1
vote
1answer
52 views

Can we put an SPWeb object into a SPSite object?

This is possible: using (SPSite site = new SPSite(SPContext.Current.Site.WebApplication.Sites[0].Url)) Is this possible?: using (SPSite site = new ...
0
votes
1answer
128 views

What is difference between SPSite.Url and SPSite.RootWeb.Url

What is difference between: SPSite.Url SPSite.RootWeb.Url If both are same, Which is considered to be good practice?
0
votes
2answers
202 views

What is difference between SPSite spSite = SPContext.Current.Site; and SPSite spsite = new SPSite(SPContext.Current.Web.Url)

What is difference between SPSite spSite = SPContext.Current.Site; and SPSite spsite = new SPSite(SPContext.Current.Web.Url) Which is good practice?
0
votes
2answers
85 views

Migrate SP2013 Enterprise to New Farm with SP2013 Standard with new SQL Server

I was hoping to get some advice on the best way to migrate from an Existing SharePoint 2013 Enterprise Farm, to a completely new Farm running SharePoint 2013 Standard. I will need to migrate User ...
0
votes
3answers
714 views

Error creating SPSite using powershell

I am trying to create a web application "http://Intranet" and a site collection "http://Intranet" on SharePoint 2013 foundation farm. Here is my code $sp = New-SPAuthenticationProvider $web = ...
0
votes
3answers
102 views

What is Site, Web, Site Template and Web Template in SharePoint?

Can anyone please tell me what the difference is between Site and Web in SharePoint. Also what is Site Template and Web Template?
1
vote
1answer
84 views

Best way of retrieving a collection of SPSite in code

I have a page where the user will be entering a data in a textbox, and click submit, and it brings all site collections that url contains this data in textbox, I am currenlty doing a Linq query to ...
0
votes
0answers
135 views

SPSite.RootWeb.WebTemplate throws UnauthorizedAccessException

I'm trying to make some unit tests for a SharePoint Application. First I make an instance of an SPSite (using the string requestUrl constructor) then I fake my SPContext with the method described here ...
0
votes
1answer
196 views

The Web application at http://myWebsite.myCompany.nl could not be found

I have some custom code which is trying to get some item value from a list. First I wil try create a spsite object. But I got this error: Exception in GetConfigValue:PortalName, problem: at ...
1
vote
1answer
37 views

Error Acessing Remote SharePoint 2010 sites within same network from .NET 3.5 Windows Application

We have been working on a .NET Windows Application for doing Admin tasks and some validation in SharePoint 2010 , since the tool needs to have the functionality to do a site backup and restore I have ...
7
votes
1answer
253 views

What does SPSite.LastContentModifiedDate track?

What causes SPSite.LastContentModifiedDate to be updated with a later date? Does it track: changes to the definition of lists/fields/content types or just the content stored in them? changes to ...
2
votes
3answers
358 views

SharePoint 2013 Using SPSite in Custom WCF Content Enrichment Webservice

I have to write a content enrichment webservice which retrieves data from an specific SharePoint Site (SPSite). But my code doesn't run, if i make a new SPSite Object. Also no logging information in ...
1
vote
1answer
182 views

Best way to copy site collections

I am looking in to copying a whole SP 2013 collection to a new one. (target URL could be in the same server or farm, though unlikely) I want to mention that, this is meant to be a 'copy machine' to ...
1
vote
1answer
3k views

Is it possible to get an SPList object with just a Url?

I have a url field that contains the url of a Discussion board that I will be creating a new item for. Thing is this discussion board can be in any site or web. So far I have two ideas but would like ...
0
votes
2answers
261 views

How to get SPSite in ASP.NET Web Site Project

I'm trying to use SP 2010 site from ASP.NET Web Site Project and when I create a new instance of SPSite I get this error: The Web application at could not be found. Verify that you have typed the URL ...
0
votes
1answer
97 views

How to access a site on another machine in the same domain programmatically?

I have a site on DOMAIN\PC1 with url http://site1. I can access it by using following code (code is running on DOMAIN\PC1): using(SPSite site = new SPSite("http://site1")) { } Also there is a site ...
2
votes
2answers
1k views

Powershell Enumerate through all site collections but not include one specific site collection

I am partially not even sure how to Google this question because whatever I type never seems to bring back any relevant search results. I currently have a working script that is set to go through and ...
3
votes
3answers
908 views

SPSite.Exists returning true for a just deleted site collection

Short story - I have a process that creates some sitecollection, so to test it I keep deleting and recreating the same site over and over. The process includes a check with the istruction ...
1
vote
3answers
119 views

How to get all SPWebs using visual studio?

I want to get all webs including it's subwebs. Eg. Site web1 subweb1 subweb2 web2 How to achieve ?
2
votes
1answer
133 views

Is there any way to validate site ID without instantiating SPSite?

I need a fast way to ensure that site ID is correct. Instantiating SPSite seems to be quite expensive, so may be there are other options to do this.
0
votes
1answer
609 views

Accessing SpSite from a Thread or ThreadPool

I have a couple of question regarding developing multithreading webparts in Sharepoint. First, let me explain the idea. I have a page with 5-7 different webparts. These webparts are constructed all in ...
0
votes
4answers
4k views

Detected use of SPRequest for previously closed SPWeb object after SPQuery

this code run yesterday very well and today I've been trying to solve this error for hour now : Please close SPWeb objects when you are done with all objects obtained from them, but not before I ...
0
votes
1answer
418 views

SPSite - exception Microsoft.SharePoint.SPSecurity.GetRolesForUser

I am trying to open site(FBA enabled with custommembership & customroleprovider) through module/httpmodule. It is throwing error System.NullReferenceException: Object reference not set to ...
0
votes
2answers
1k views

Get all SPLists for a site collection

I feel like I'm very close on this one. I know how to get the root site collection from this: How can I get the root site collection from SPContext.Current? I've been messing around with ...
0
votes
3answers
1k views

SPSite and SPWeb object dispose inside foreach loop

I have a code that loops through all the Sites and Webs in a web application. My code uses for..each loop to navigate through each site and web object. I was wondering if we are required to dispose ...
9
votes
9answers
14k views

SPSite - The Web application at <address> could not be found

I'm trying to use SP 2010 site from a web application and when I create a new instance of SPSite I get this error: The Web application at could not be found. Verify that you have typed the URL ...
4
votes
2answers
510 views

Can you call SPSite on a different machine to SharePoint setup?

I'm trying to call SharePoint from within a standard .NET class library. This will probably be hosted on a different server to SharePoint. I just need to return an item from a list, and wondered if I ...
1
vote
2answers
2k views

Get file from any library in the web tree

Is it possible to use some built in SharePoint API to open a file no matter which web and library it's in? Example: Given the file: /subsiteA/PublishingImages/myimage.jpg I want to open it and get ...
3
votes
1answer
185 views

Disposing of SPWeb object query

I'm trying to understanding the object clean up process. using (SPSite siteCollection = new SPSite(siteUrl)) { SPWeb site = siteCollection.RootWeb; foreach (SPList list in site.Lists) { if ...
1
vote
1answer
3k views

Share List between subsites of sharepoint2010

Anyone know how can we share one subsites list to another subsite ? I want to allow all operations also and also want to put in read only mode in another subsite. Anyone have idea how can i do this ? ...
0
votes
3answers
2k views

SPSite Object Problem When Trying To Loop Through Sites

I'm working in a Sharepoint 2007 environment. I'm trying to loop through a site, and it's subsites, and add a webpart to any pages found. #Add SharePoint assemblies ...
2
votes
2answers
528 views

SPSite.Usage.Storage And SPSite.StorageManagementInformation Are Returning Different Values

When every I use SPSite.Usage.Storage and I use SPSite.StorageManagementInformation with to retrieve all the documents for the Site Collection then I sum the sizes of all the documents then I get a ...
1
vote
1answer
586 views

NullReferenceException when instantiating UserProfileConfiguration

I'm following the instructions at How to: Create and Edit a User Profile Property. I keep getting a NullReferenceException on the call to the UserProfileConfigManager constructor. The context ...
0
votes
1answer
117 views

How do I read pagecolumns from the current page

I know that I have to use SPSite site = new SPSite("SPsite Path"); SPWeb web = site.OpenWeb(); SPList contacts = web.Lists["Listname"]; if I need to get content of a List, but how do I read data ...
1
vote
1answer
671 views

Values in SPSite.UsageInfo are always zero

I am trying to retrieve information about site usage via SPSite.UsageInfo programatically or via PowerShell. Here is simple PowerShell code: $site = Get-SPSite "http://intranet" $site.Usage And it ...
2
votes
2answers
2k views

How do I get an SPSite from SPWebEventProperties?

How do I get an SPSite object from the SPWebEventProperties object passed into the SPWebEventReceiver.WebProvisioned method? public override void WebProvisioned(SPWebEventProperties properties)
11
votes
3answers
2k views

Should I dispose these SPSite and SPWeb objects?

Is it necessary to dispose the site and web objects in the following code? If so, how do I do this? Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim site ...
0
votes
3answers
2k views

SPSite Credential

Hey , i created a sample application with take Site name as parameter and get all the list of that site, thats working fine on my local system , but it throws exception when i give the site address of ...
0
votes
1answer
977 views

How to get a document library URL from an SPSite object?

I have some documents in a document library in SharePoint 2007. The URL is http://abcd:24931/docu/Forms/AllItems.aspx. I need to display these documents in a data grid view of a Windows form ...