We must have noticed that for certain solution packages (.wsp), SharePoint only provides the option to Deploy it globally. This is a big drawback for applications that were meant to target certain Web Applications only.Due to the fact that the wsp is deployed globally, an IIS Pool recycle will be performed bringing down all the WebApplications, even though the current solution package (.wsp) was targeting only some of them (or even one of them).
To avoid this, simply follow the following steps:
=> If you have selected the first option, “Add Existing Assembly” then, select the source path, of your current dll.
=> If you have selected the option, “Add Assembly from Project Output” then you have to select the source project instead of just a dll.
=> The location field will be automatically updated.
=> Leave the deployment target at GlobalAssemblyCache.
=> Copy the name of the dll from the Location field without “.dll” part.
=> Under SafeControls, Click to add a new item.
=> Double-Click the Namespace field and paste the item you just copied. Do the same for Assembly Name field.
=> Click OK to close the window.
=> You should now be able to see the following screen.
=> Select your project in Solution Explorer, press F4 and set “Include Assembly In Package” as False.
Finally, deploy your solution and check the same in Central Administration. You can now see that your wsp has been deployed to a given Web Application only.
One thought on “Prevent SharePoint solutions from getting Deployed Globally”
I think that is an interesting point, it made me think a bit. Thanks for sparking my thinking cap. Sometimes I get so much in a rut that I just feel like a record.
This is really some awesome advice. Keep it up, my colleagues would love this.