I am totally confused on how WSP files need to be deployed and activated inside SharePoint 2013.now I have the following three scenarios where i dealt with WSP files inside my SharePoint 2013 :-
- I needed to create a new column type that allows having lookup columns with autocomplete capabilities. So I found this link
Where I added the feature by running the following:-
Adding Solution:
stsadm.exe -o addsolution -filename C:\NY.Autocomplete.LookupField.wsp
Deploy Solution:
stsadm.exe -o deploysolution -name NY.Autocomplete.LookupField.wsp -immediate -allowgacdeployment
I also need to add a custom redirect to my SharePoint server 2013 ,, as mentioned in this link link .so I created a new visual studio project of type "Farm solution" ,and i added the following code :-
protected override void OnInit(EventArgs e) { var request = HttpContext.Current.Request; var response = HttpContext.Current.Response;
if (!String.IsNullOrEmpty(request.QueryString["TreeField"]) && !String.IsNullOrEmpty(request.QueryString["TreeValue"])) { response.Redirect(String.Format("{0}?TreeField={1}&TreeValue={2}", SPContext.Current.ListItem.ParentList.DefaultViewUrl, request.QueryString["TreeField"], request.QueryString["TreeValue"])); } else if (!String.IsNullOrEmpty(request.QueryString["TreeField"])) { response.Redirect(String.Format("{0}?TreeField={1}", SPContext.Current.ListItem.ParentList.DefaultViewUrl, request.QueryString["TreeField"])); } base.OnInit(e); } protected void Page_Load(object sender, EventArgs e) { }
and I deploy it in the same way as used in the first point.
- Now I want to add new custom site columns as mentioned on this link link. then I upload the wsp to my site collection using the solution gallery.
I have the following points:-
Now for the first point the new site column type was automatically added to all the site collections, without even activating any feature at the site collection level.
While for the second solution the new solution became available under “custom web parts” only after activating the related site collection feature
While for the third point when I upload the wsp to the site collection gallery a new “site feature” not site collection feature , became available and I activate this.
So my question is what determine which approach to follow & the associated Behavior?
I mean why in the first approach the new site column type will be available to all the site collections without the need to activate any site collection feature ?. While in the second approach , I need to activate a site collection feature to get the new web part available inside the “custom web part” tab.
While in the third approach used for adding new site columns, I can upload the solution to each site collection separately?