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

1
vote
0answers
16 views

Timeout using SPsite object and U2U Caml query

We have 2 collection. 1 is test and other is production environment. In test collection, I'm writing console application which is using SPSite and SPWeb objects. But it takes nearly 40minutes to get ...
0
votes
1answer
20 views

Create a site collection in root path with PowerShell

I am trying to create a new site collection with powershell in the root path http://mysite/search/ $siteName = "Search"; $webAppUrl = "http://sharepoint"; $siteUrl = ...
11
votes
10answers
21k 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
1answer
40 views

Using Visual Studio, how can I reference a SharePoint 2010 site collection outside of the development machine?

I am creating a custom web service which needs to reference a specific site collection on our SharePoint 2010 farm. The web service is on a development machine not part of the farm (although ...
0
votes
1answer
40 views

Move-SPSite: Cannot find an SPSite object with ID or Url

One of my sites has grown large, and I want to move it to a new Content DB. I've created a new content db, ResearchDB, successfully added it to SharePoint (New-SPContentDatabase), and checked ...
0
votes
2answers
24 views

I am getting Cannot find an SPSite that contains the following…Error

I have a PowerShell script below: Add-PSSnapin Microsoft.SharePoint.PowerShell function Get-DocInventory([string]$siteUrl) { $web = Get-SPWeb "http://contoso.com/sites/Test10" ...
0
votes
1answer
8 views

is either new SPSite(string url) or new SPSite(GUID guid) better than the other? how

I have cached access to either the Url or the GUID for multiple SharePoint site collections (SPSites), and I am trying to create new references to them for permissions purposes (SPSite constructor). ...
2
votes
4answers
685 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 ...
2
votes
2answers
132 views

SPSite.Exists always returns false

I am trying to determine if a site collection exists, but the SPSite.Exists method always seems to return false regardless if the site collection exists or not. Snipp: bool exists; Uri uri = new ...
1
vote
0answers
54 views

Programmatically created SPWebApplication's WebParts not registered as safe

I am having a frustrating issue with a programmatically created web application in which a programmatically deployed solution's web parts are not registered as safe when adding to a programmatically ...
3
votes
3answers
1k 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 ...
0
votes
2answers
22 views

Ideas underpinning SPSite and SPWeb [duplicate]

Edit: I'm not sure this will help, but I'll try: I am asking "what's the whole idea with wheels?"; a list of wheel parts is not what I am after. /edit I'm aware that SPSite - despite the confusing ...
1
vote
0answers
29 views

Best practice for re-using the SPWeb object across code layers/services

I have several services that use the SPWeb object. These services are called to perform various functions, sometimes completely unrelated. i.e. an AuthenticationService uses SPWeb to get information ...
1
vote
1answer
38 views

Determine if object is SPSite or SPWeb

I have a simple question, how to determine with PowerShell if a SharePoint Site is a SPSite object or SPWeb? I get all Site followed by user but some are SPSite.
0
votes
1answer
884 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
1answer
195 views

The language is not supported on the server

I installed Language Packs for SharePoint Server 2010 from: https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=3411 On creating a new site collection using PowerShell with ...
0
votes
3answers
2k 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 ...
1
vote
3answers
2k views

Site.OpenWeb() VS Site.RootWeb()

Just want to clarify between the two: what web variable will hold in both cases: SPWeb web = Site.OpenWeb(); SPWeb web = Site.RootWeb();
0
votes
1answer
191 views

how to get spsite title only

Right now my code gets the URL from my SPSite but I only want to get the Title var url = portalUrl.Text; if (SPSite.Exists(new Uri(url))) { using (SPSite oSiteCollection = new SPSite(url)) { ...
0
votes
1answer
111 views

Why is IsCurrentUserMemberOfGroup throwing an exception when run on SPSite.RootWeb?

Running this code in PowerShell (or even in a web context in C#) gives an unexpected behavior: Calling IsCurrentUserMemberOfGroup directly on the RootWeb object gives an exception, and worse: it ...
0
votes
3answers
2k 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
1answer
524 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 ...
1
vote
1answer
353 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?
2
votes
2answers
766 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 ...
4
votes
1answer
260 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
69 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 ...
1
vote
1answer
803 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
738 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
462 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
2answers
278 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
2answers
5k 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
396 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
60 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
674 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
485 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
3answers
882 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
135 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
1answer
341 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
55 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 ...
9
votes
1answer
541 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 ...
1
vote
1answer
317 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
6k 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
385 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 ...
1
vote
3answers
151 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 ?
0
votes
1answer
147 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
2k 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 ...
0
votes
4answers
5k 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 ...
2
votes
1answer
145 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
2answers
2k 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 ...
3
votes
1answer
189 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 ...