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
12 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
18 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
767 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
10 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
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 ...
1
vote
3answers
214 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
53 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
0answers
9 views

calulate dynamic url according to the zone

I have created a new url for Custom zone of a Site Collection using Set-SpSiteurl. I have a Visual Web Part which displays items in a custom list. Each item in this list has a SPFieldUrlValue. I would ...
2
votes
4answers
499 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 ...
0
votes
1answer
90 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
1k 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
466 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
88 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
616 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
147 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
115 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
50 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
425 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
599 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
322 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
145 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
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
238 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
56 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
357 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
332 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
159 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
98 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
294 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
46 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 ...
8
votes
1answer
379 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
253 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
4k 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 ...
9
votes
9answers
16k 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 ...
0
votes
2answers
303 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
132 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
109 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 ...
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 ...
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 ...
2
votes
1answer
138 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
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 ...
3
votes
1answer
188 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 ...
4
votes
2answers
557 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
3k 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 ...
1
vote
1answer
2k 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
1k 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 ...
1
vote
1answer
596 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
120 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
778 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 ...