Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How can we avoid the Globally Deployment of a WSP using Visual Studio 2010?

share|improve this question
    
Maybe these should be merged. This question is more thorough, though the other question has more activity. –  RJ Cuthbertson Jun 11 at 3:34
add comment

7 Answers 7

up vote 1 down vote accepted

The best method I've found to avoid Visual Studio 2010 deploying your solution to all Web Applications and auto-activating all features is to not use Visual Studio 2010 for deployment (unfortunately). I keep a PowerShell window handy for deployment and feature activation purposes.

However, you can also create your own "Deployment Configuration" by right clicking on your project in the solution explorer, clicking the "SharePoint" tab, and creating a new "Active Deployment Configuration" based on the "No Activation" configuration that uses a post-deployment command line to deploy the solution to your chosen web application and activate any specific features you'd like.

Clarification: Microsoft has documented how to create and/or edit your Active Deployment Configuration on this MSDN page: How to: Edit a SharePoint Deployment Configuration. It also contains information about where to find these settings.

share|improve this answer
    
could you pleaase explain because I can't find the settings as you mentioned –  Geek Jun 15 '12 at 23:27
add comment

I've sometimes had to add a dummy SafeControl, just so the WSP identifies itself as needing to be deployed to a particular webapp.

share|improve this answer
add comment

I'm not really sure what you are asking here. When I run deploy on my dev box which is where visual studio is installed, it only installs to the SharePoint install on my dev box. What type of setup do you have?

Or are you referring to how to create a sandbox solution vs a farm solution?

Please clarify your question. Thanks!

share|improve this answer
    
I have visual studo 2010 installed on my Dev box. I am talking about farm solutions –  Geek Jun 14 '12 at 17:39
    
So you are asking how to create a sandbox solution instead of a farm solution? –  Steve Lineberry Jun 14 '12 at 18:46
    
no, my question is how to deploy WSP solution created by a Visual Studio 2010 to a specific Web Application instead of Globally Deploying it –  Geek Jun 15 '12 at 23:26
    
I'm not sure you can, but you can make web application scoped features and then only activate the features in your solution for the web application that needs it. –  Steve Lineberry Jun 16 '12 at 2:46
1  
Why don't you just tell me what you are trying to accomplish? What is in your solution? –  Steve Lineberry Jun 16 '12 at 10:48
show 1 more comment

You can set the scope of the WSP package from Visual Studio. Double click the Feature and select Scope: Web (for web application), or Site (for site collection).

When you deploy the package, for web or site scope, you specify the Url to deploy to.

Here's a link for reference: http://msdn.microsoft.com/en-us/library/ee231544.aspx

share|improve this answer
add comment

If you want to deploy your application page which are accessible like http://{site}/_layouts/yourpage.aspx then it is doesn't really matter if you deploy them Globally (across all web applications) or to a specific Web application because they will get deployed as an application page under layouts folder and will be accessible from any Web application.

Anyway, as Russel said, you can change their scope using Visual Studio 2010.

share|improve this answer
add comment

You can select the Web Application to which the solution is deployed. You cannot further limit solution to specific Site Collection within Web Application.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.