9

Remove feature receiver Clean solution Close Visual Studio Delete SharePoint project's obj folder in Windows Explorer Delete SharePoint project's bin folder in Windows Explorer Open Visual Studio and re-add feature receiver Start Debugging


8

Ok so the Get-SPFeature works differently depending on what parameters you pass it. The following line is asking which features are enabled at the Web Scoped level. $webFeature = Get-SPFeature -Web $spSiteCollection | Where-Object.... However, if you want to see if your feature is installed then you need to use Get-SPFeature without passing any scope to it....


7

My issue got resolved. This may help someone in future. What I tried: Since the feature was not getting displayed in "Manage Site Features", I tried to enable feature using powershell. Enable-SPFeature -identity featureID -URL yoursiteURL This command failed with error: The feature is not a Farm Level feature and is not found in a Site level defined ...


5

Here is the C# version of Anders answer as it was not as straightforward as I would have thought. public static void SetFormJSLink(this SPList list, PAGETYPE formBaseView, string jsLinkUrl) { var file = list.ParentWeb.GetFile(list.Forms[formBaseView].Url); file.CheckOut(); using (var manager = file.GetLimitedWebPartManager(PersonalizationScope....


4

If you dont use powerGUI but use powershell.exe: Go to: C:\Windows\System32\WindowsPowerShell\v1.0 Find: powershell_ise.exe.config Change: <?xml version="1.0" encoding="utf-8" ?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" /> </startup> <...


4

make sure the solution deployment job was finished before you activate the feature. have a look at this blog: Programmatically waiting on SharePoint Solutions to deploy


4

function Deactivate-SPFeature { param ($FeatureID, $SiteUrl, $WebApplicationUrl) $Feature = Get-SPFeature -Identity $FeatureID -ErrorAction SilentlyContinue $IsActiveFeature If ($Feature -eq $null) { Write-Warning "The specified feature ($FeatureID) was not found." return } If ($Feature.Scope -eq [Microsoft....


4

I have faced the same situation many times. I used a tool called Feature Admin. It shows any features that are isolated and cannot be used including error occured. You can delete the unwanted or error occurred features through it.


4

Go to Site Content Types, then, go to the Document Content Types section Click Document in that section Click Advanced on the Site Content Types for that content type In the Read Only section of that page click YES Click OK Source: Geoff Evelyn's answer here: https://social.technet.microsoft.com/Forums/en-US/bc53d0ff-b7b4-4cc3-b3e9-87af23f8ba8e/...


4

Make the feature scope in Visual Studios be "Site" instead of "Web". https://msdn.microsoft.com/en-us/library/ee231541.aspx


4

You should be aware of the PWA setting can not be enabled on a publishing site, it only activated on the Team Site or Project Site template. For more details check Add Project Online to a site collection


3

You should get site url as below. string siteUrl = this.Properties["SiteURL"].ToString(); and use below code to get current web in timerjob. using (SPSite site = new SPSite(siteUrl)) { using (SPWeb CurrentWeb = site.OpenWeb()) { // Write code here } }


3

Have you tried viewing logs with ULS viewer? I think your problem might be that you are using SPContext.Current in a timer job.


3

I managed to fix my problem. After doing a lot of research I learned that if a Web Application-level feature contains an event receiver, then that assembly must be deployed to GAC. This will however cause SharePoint to deploy the wsp package globally. But I wanted to deploy the package to a specific web application. So I went to the package design window, ...


3

It seems that for JSLink to work on the display/new/edit forms you need to set the JSLink on the webpart used in the forms, not directly on the form itself. The following PowerShell code works for the new form on a blog post and should be easy to adopt to your needs in C#: $web = Get-SPWeb "http://myportal" $file = $web.GetFile("Lists/Posts/NewPost.aspx") $...


3

You can use feature stapling to achieve this. You just deploy a simple element file in a feature and activate it at the web application level. <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <FeatureSiteTemplateAssociation Id="the guid of the feature to staple to new sites" TemplateName="...


3

Looks like it is a DLL caching issue. When you start Powershell command line window, it loads all DLLs available in the GAC. So, if you have updated DLL for the feature receiver, and deploying it within the same PS session then it will not reload updated DLL. I had experienced similar behaviour before. To tackle it, I created two seperate PS1 files. First ...


3

You can put the specific term store name in the Site property bag and in the feature receiver fetch it from there.


3

Well. It really depends on which feature you have to activate. The id of a feature does not change during its life. This means that if you can find out the id you will be sure it stays the same, regardless of the specific SharePoint farm instance. That said, you can "hardcode" your ID in a support class, much like SharePoint does with fields id in the ...


3

Absolutely, you can deploy custom webparts on SharePoint installed on a Standalone server as well as on a Farm server. In fact, many development environments are built on Standalone server. There's been a discussion on Using a development farm or standalone? so you can look at it for more opinions. One thing you should note, if you need User Profile ...


3

I have found that earlier versions lacked the selected items property but the current version, 5.28.0, includes the selected items property and with that I was able to set the default select. I didn't have any luck getting the default selected items to work unless I had the value the first time the component was rendered. If I passed a default and then based ...


3

Few list templates are not available in communication site template. You can enable 'Team Collaboration Lists' in site features to get the picture library templates installed. Navigate to the https://yoursite/_layouts/15/ManageFeatures.aspx and activate the the feature.


2

PowerShell: if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null) { Add-PsSnapin Microsoft.SharePoint.PowerShell } $DocumentRoutingFeatureId = "7ad5272a-2694-4349-953e-ea5ef290e97c" Enable-SPFeature -Identity $DocumentRoutingFeatureId -Url $url -ErrorAction Stop where $url corresponds to Url of web, since ...


2

For Site and Web scoped feature, only way is to use the powershell to activate the feature after it is deployed. (But for Farm and Web Application scoped features, Go to the manifest of your feature and set "ActivateOnDefault" to true, this will cause the feature to get activated automatically whenever the solution is deployed using powershell or central ...


2

You need the .wsp file that contains the features. You can create with Visual Studio by right clicking the Project and hit on Publish option. First af all, open a SharePoint Management Shell. You have to add the Solution to SharePoint with this command: Add-SPSolution -LiteralPath $SolutionPath Then, install the solution: $Url = "http://urltoinstall" $...


2

The feature scope is defined within the feature definition, it is not set via PowerShell. If it is a Site level feature, then you will need to activate it individually for every site in your web application (if that's what you want).


2

I think you need to refer to web url instead of site collection url in the following line, since you are looping through each web in the site collection InformationMessage "Trying to activate $webFeatureName at $spWeb.url" Enable-SPFeature –identity $webFeatureName -URL $spSiteCollection -Confirm:$false -ErrorAction:SilentlyContinue It should be Enable-...


2

This might also help someone: Get-SPSite -Limit All| Where-Object {(Get-SPFeature "PublishingSite" -ErrorAction SilentlyContinue -Site $_.Url) -ne $null } | Select Url Taken from this blog post. See full reference: https://technet.microsoft.com/en-us/library/ff607945.aspx


2

You should not use SPContext for opening the site! In PowerShell or from Visual Studio the SPContext.Current will always be null. This is because it relies on the HttpContext, that will not be initiated when using PowerShell. If your feature is Site scoped you can use var parentSite = properties.Feature.Parent as SPSite; using (SPSite site = new SPSite(...


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