Tuesday, June 4, 2013

Deploy Globally vs Deploy by Web Application SharePoint 2010

I've been working on a SharePoint 2010 solution for a client that is currently in UAT and we've been deploying bug fixes every other night. The solution includes some site scoped features and was always deployed Globally in our development environment. This was never a problem.

Once we moved to UAT and deployed the solution to our Stage environment we found deploying the solution took almost 40 minutes. This stage environment contains two Web Front Ends as well as a few web applications.

So I began looking into how I could get this solution which contained only site scoped features, to deploy to only our web application.

Everything I read said that a modification to the manifest.xml was the answer, specifically adding in SafeControl entries that will be added to the web.config file of that web application.

We're using Visual Studio 2012, so I figured there had to be some way that I could get VS to create these entries automatically.

The solution was to open up the Package folder of my project and then double click the Package.package and go to the Advanced tab. I then went through each assembly I had and Clicked the Edit button. Low and behold, there was the Safe Controls section. I clicked the button that let me add a new one, typed in the Namespace and Assembly Name for each assembly and then pressed OK (VS had OK greyed out until I moved my cursor focus outside of the Safe Controls section for some reason).

Now, even when I deploy from Visual Studio in my development environment, my solution gets deployed to only my web application! I was then able to use a PowerShell script with the -WebApplication flag to deploy it much faster in our Stage environment.

No comments:

Post a Comment