I have a solution with several site/web scoped features (SP2010). Id like to deploy this solution to one specific web application. The features should only show up in the sites/webs which reside in this web application.
By adding Safe Control Entries to my solution I am able to deploy the solution to a specific web application. However, the features of my solution still show up in all other web applications.
There is a similar question on SO, see Creating a solution that deploys to selected WebApplications but copies the assembly to GAC. From the answers given, it seems that it is not possible. However the TS himself states that it is actually working (for him).
EDIT To make things clearer, my confusion is probably best summarized by the following question:
Why is it possible to activate a feature on a web application where it has not been deployed to?
Here are couple of links( I have already tested) which will provide you solution
http://sharepointempower.com/2013/01/deploying-solutions-to-a-specific-web-application-2/ http://aravindrises.blogspot.in/2013/03/deploy-sharepoint-solutions-at-web.html
This visibility is certainly a pain especially when you have a ton of site collections a huge variable user base. Adding new things into the Features list for people to mess with can be problematic since it can cause more support headaches than it is worth.
If you really want to keep things from being exposed to others, you will most likely need to deploy these features as hidden features and then activate them from the command line for the people who need them. I suppose you could also write your own Feature admin screen that would take into account the current web app.
No, you cannot control the visibility of web/site scoped features to single web application. They will be either visible in all of them or none.
My first question would be why do you want a restriction like this ? A feature should be reusable component which can be activated anywhere once deployed. Note that however, the activation needs Administrator previleges.
If you really want to restrict:
- Hide it and use powershell or stsadm script to deploy.
One simple way to prevent users from enabling a feature in a web application, where you don't want them to, is to make all the site scoped features dependent on a web application scoped feature.
Use Sandbox Solution For this. Because Sandbox solutions are not stored in File System(Physical path) and assemblies can't be deployed to Global Assembly Cache(GAC).