Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
15 votes
Accepted

Difference between Farm solutions and Provider-hosted Apps

Yes, your trouble is quite understandable! First, you should read that "controversial" discussion we had here a few days ago: SharePoint development past and "future": how to keep calm?. ...
Evariste's user avatar
  • 9,731
9 votes
Accepted

Can i create site columns, content types by publishing a sharepoint-hosted APP

I read that sandbox solution is not preferred in SharePoint 2013 and we should use the app model. So is creating artifacts an available approach to do inside SharePoint apps? Yes there are multiple ...
Robert Lindgren's user avatar
7 votes

EnsureUser() will return the following error "The specified user could not be found. "

Can you check if the user's are still enabled in AD? This error can be occurred as if the user is not enabled in AD, though it will still show as an SP User. Please let me know what happens.
Md. Tahmidul Abedin's user avatar
6 votes

how do I copy web application from one farm to another in SharePoint 2013

You would need to Create a new Web Application in farm 2 Export solutions* from farm 1 Install solutions in farm 2 Backup content databases belonging to the web application in farm 1 Restore all ...
Benny Skogberg's user avatar
  • 25.5k
6 votes
Accepted

How to resolve "Your search cannot be completed because no Search service is available. Contact your administrator for more information."?

Add the Microsoft.Office.Server.Search.Query reference to your solution Then in your code behind, use this reference as the following using Microsoft.SharePoint; using Microsoft.Office.Server....
Mohamed El-Qassas MVP's user avatar
4 votes

Access is denied. inside my ItemAdded event receiver

try it as below: public override void ItemAdded(SPItemEventProperties properties) { base.ItemAdded(properties); SPUserToken systemAccountUserToken = SPContext.Current.Site.SystemAccount....
Gautam Sheth's user avatar
  • 30.9k
4 votes
Accepted

How to move C# wsp from SharePoint 2010 to SharePoint Online

You can't do this easily. Farm solutions and sandbox solutions with custom code aren't supported in SharePoint Online. Generally you must rewrite your application as SharePoint Add-in (SharePoint-...
Paweł Hawrylak's user avatar
4 votes
Accepted

Future of Farm Solutions for Sharepoint

As far as I have information, I doubt anything will change with respect to farm solutions. They exist since the first version of SharePoint and are the most powerful way to develop solutions in ...
Juan Pablo Pussacq Laborde's user avatar
3 votes

how do I copy web application from one farm to another in SharePoint 2013

Due to customization, most of stuff is manually and required extra steps. Build New Farm( make Sure it should be same version level) Create and Configure the Service Applications Create a New Web ...
Waqas Sarwar MVP's user avatar
  • 56.8k
3 votes
Accepted

incorrect documentation about the SPItemEventProperties.OpenWeb() method inside visual studio 2012

The SharePoint terminology is vert confusing. Officially, you have the "site collections", and each site collection contains "site"s (the root site and all its sub-sites are sites). There's no "web"...
Evariste's user avatar
  • 9,731
3 votes

unable to get all the term sets under a term group inside my event receiver

Please try this once. private static TermSet RetrunTermSetIfExists(ClientContext clientContext, TermGroup termGroup, string termSetName) { clientContext.Load(termGroup.TermSets); ...
Vainktesh Kumar's user avatar
3 votes

EnsureUser() will return the following error "The specified user could not be found. "

There are few caveats you need to check when working with EnsureUser EnsureUser will work only if the user is available in that particular Site collection. Check if user is available in any site ...
Dinusha Kumarasiri's user avatar
2 votes
Accepted

How to loop through all subsites under a subsite using SharePoint server object model

You can use the code as below: using(SPSite site = new SPSite("http://servername/")) //site collection url { using(SPWeb web = site.OpenWeb("customers")) //specific subsite url { ...
Gautam Sheth's user avatar
  • 30.9k
2 votes
Accepted

how to Deploy farm solutions in release mode

You have to: Change the Mode to 'Release' Publish the solution to a location. Use the Add-SPSolution, Install-SPSolution in Power-shell for deployment
Sudhakar's user avatar
  • 579
2 votes

Is there a way to automatically create a new subsite when an item is created inside a list using APPs

This you can achieve through by creating a Remote Event Receiver instead of a farm solution in SharePoint 2013 , to create a Remote Event Receiver you should develop a Provider Hosted App. In Remote ...
Esaki's user avatar
  • 1,272
2 votes
Accepted

SharePoint 2016: Deploy Error - Unable to load one or more requested types.Retrieve the LoaderExceptions property for more information

Resolved the issue with: Uninstall the Visual Studio 2015 Community. Cleared the AppData/Local. Install the Visual Studio 2015 Professional. Now able to deploy without any error. Not sure that it ...
Ronak Patel's user avatar
  • 3,251
2 votes
Accepted

Creating a New User Group inside my item update Event Reciever

Try adding RoleAssigments to the new web, doing something like this (I edited a bit your code): public override void ItemUpdated(SPItemEventProperties properties) { base.ItemUpdated(properties); ...
Cecilia's user avatar
  • 984
2 votes
Accepted

Recommended way/Best Practice to create a sub-site with RunWithElevatedPrivileges inside my Event Receiver

For creating sub sites in event receiver you would need to create new instance of SPweb via url because of RunWithElevatedPrivileges. Also your worry on below Calls to the Update method on these ...
Siddharth Vaghasia's user avatar
2 votes

Differences between SPItemEventProperties.SiteId & SPItemEventProperties.Web.Site.ID

Conceptually, they are the same. First, lets consider the SPSite initialization. properties.siteID and properties.Web.Site.ID will just result in the same site collection ID, so either case ...
SPArcheon's user avatar
  • 6,866
2 votes

Differences between SPItemEventProperties.SiteId & SPItemEventProperties.Web.Site.ID

You can simply use SPItemEventProperties.Web in this context (remember do not dispose it). SPWeb web = properties.Web;
Gennady G's user avatar
  • 1,623
2 votes
Accepted

Can i get the current user whose action caused the ItemUpdated event receiver to fire

Question 1) Inside the MSDN link you attached, someone mentioned that on the After event receivers you cannot get the user who cause the event receiver to fire. That's incorrect, you can access the ...
Cecilia's user avatar
  • 984
2 votes

Differences between using properties.OpenWeb() and using properties.Web inside my event receiver

You should follow the 2nd approach. It is a best practice to use properties.Web inside the event receiver. Do not instantiate an SPWeb, SPSite, SPList, or SPListItem object within an event ...
Gautam Sheth's user avatar
  • 30.9k
2 votes
Accepted

How i can get the current PublishingSite & PublishingWeb from SPItemEventProperties inside my Event Recevier

TL;DR; 1) No, you don't violate MSDN recommendations. 2) No need as per 1) When you call new PublishingSite(properties.Site);, you don't create new SPSite or SPWeb objects. These 2 objects are "...
Evariste's user avatar
  • 9,731
2 votes
Accepted

Difference between Elements.xml and Schema.xml

I think the accepted answer you're pointing is not completely accurate. The question raised in that post is more probably "Why do all examples I see insert the fields twice?" instead of "Why do I need ...
Evariste's user avatar
  • 9,731
2 votes

Can i apply JSLINK to my WebPart inside my Event Receiver

When you create a site based on a template which includes your "Business Risks"-list, this process includes a hidden step where a List View Web Part associated to the "Business Risks"-list is created. ...
moe's user avatar
  • 5,267
2 votes
Accepted

Can i apply JSLINK to my WebPart inside my Event Receiver

Try the below code after your subsite is created: Option 1: - easier, simpler SPList brlist = web.Lists.TryGetList("Business Risks"); SPView brlistDefaultView = brlist.DefaultView; ...
Gautam Sheth's user avatar
  • 30.9k
2 votes

EnsureUser() will return the following error "The specified user could not be found. "

I worked with EnsureUser and found out that there are a few inconveniences. For example, we need almost always to use elevated privileges to deal with EnsureUser, otherwise exception will be thrown. ...
Sunil Sahu's user avatar
  • 1,768
2 votes
Accepted

Can i get my Event Receiver source code from a WSP file

You can use free trial of .Net Reflector tool to view the source code of dll files. Decompiled Source code would not be the exact same as that was in your .cs files but you will get an overall idea ...
Yayati's user avatar
  • 1,728
2 votes
Accepted

SharePoint Version Upgrades - Are these farm solutions still viable?

Usually there are features associated with SharePoint solution files. So, if you don’t deploy these solution files some of the features won’t be installed in to the new environment. However, these ...
Prasanna Ruwangana's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible