binford
binford

Reputation: 1805

Is it possible to deploy a solution to a web application so that its features are only visible within this web application?

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?

Upvotes: 4

Views: 9854

Answers (5)

sjkp
sjkp

Reputation: 895

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.

Upvotes: 1

Rony SP
Rony SP

Reputation: 2628

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).

Upvotes: 0

Mark Mascolino
Mark Mascolino

Reputation: 2292

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.

Upvotes: 0

Madhur Ahuja
Madhur Ahuja

Reputation: 22681

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.

Upvotes: 2

Related Questions