2

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

1
  • Maybe these should be merged. This question is more thorough, though the other question has more activity. Jun 11, 2014 at 3:34

7 Answers 7

1

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.

1
  • could you pleaase explain because I can't find the settings as you mentioned
    – Geek
    Jun 15, 2012 at 23:27
5

This tutorial worked fine for me:

http://knowledge.zomers.eu/SharePoint/Pages/How-to-prevent-SharePoint-2010-solutions-from-globally-deploying.aspx

4

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

1

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!

6
  • I have visual studo 2010 installed on my Dev box. I am talking about farm solutions
    – Geek
    Jun 14, 2012 at 17:39
  • So you are asking how to create a sandbox solution instead of a farm solution? Jun 14, 2012 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, 2012 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. Jun 16, 2012 at 2:46
  • 1
    Why don't you just tell me what you are trying to accomplish? What is in your solution? Jun 16, 2012 at 10:48
0

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

0

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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