Monday, January 23, 2012

Deploying a Visual Web Part to your Remote-Hosted SharePoint Site using Visual Studio 11 (Dev Preview)

(Update: this post also published on Developer Wiki of

The Developer Preview of Visual Studio 11 is now available, and I’ve been exploring its new capabilities, especially as it relates to SharePoint development. Two of the great new features in Visual Studio 11 that I’ll discuss are

  • the ability to deploy visual web parts as sandboxed solutions
  • the ability to automatically deploy sandboxed solutions to remote SharePoint sites

At the end of this article, I’ll explain why I think this is such a big deal. But for now, I’ll walk thru the 3 easy steps necessary to take advantage of these features. In my case, the remote SharePoint site I’ll use is my Hosted SharePoint account.

1) Create your visual web part

Although this article is not an attempt to show how to create a visual web part, I do want to point out what’s different when creating a new Visual Web Part project. First, you select your New Project as you normally would:


After naming your project and hitting OK, you’re presented with another familiar screen, but this time with a new twist:


If you look carefully you’ll notice that, unlike Visual Studio 2010, we now have the option of creating our Visual Web Part as a sandboxed solution. Awesome! I then proceed to create my web part. In my case, I’ll be making a web part version of my Dog Lover’s Application that I had created in a previous post using InfoPath:


As you know, one of the key advantages of the visual web part is that I no longer have to hand-code a lot of HTML in order to create the visual aspects of my web part – I can take advantage of the ability to drag-n-drop controls onto the canvas, which greatly speeds up development time.


2) Deploy & Activate

Once I’ve coded everything and tested locally, I’m now ready to deploy to my hosted SharePoint site. It couldn’t be easier! I begin by using the Publish option in the Build menu:


In order to publish, I need to tell Visual Studio 11 where my site is located:


After providing the URL and necessary credentials, Visual Studio 11 proceeds to conveniently upload my WSP to the solution gallery of my site, as can be seen in the Output window for my Build:


It then takes me directly to the solution gallery, because I now need to manually Activate the new solution that has been deployed:



3) Insert your web part

Now that my web part is deployed and activated, I’m ready to add it to my site:


After finding it in the web parts gallery, I can add it to the front page of my SharePoint site:


Interested in seeing the web part in action? Here’s a short 30-second video clip showing the web part behavior in all its glorious simplicity. : )


So what’s the big deal?

Today with Visual Studio 2010, we can add sandboxed solutions to remote sites only by manually uploading our WSP’s to the site’s solution gallery. And if we want to deploy a visual web part to a remote site, we’d need to install SharePoint Power Tools in order to do it – Visual Studio 2010 does not allow it out-of-the-box.

So, the addition of these two features together in Visual Studio 11 adds a great bit of flexibility and convenience to our SharePoint development experience. And because of this, we remove yet another layer of complexity to using SharePoint as a development platform, thus increasing the adoption speed for new developers. I can also see a lot of value for small businesses using hosted SharePoint sites like or Office365 – now they can quickly and easily add powerful web part solutions to their site without needing complex on-premise installations.

Until Visual Studio 11 is released, I guess we’ll all have to do it the hard way for now. : ) But based on what I’ve seen so far, I think it’ll be worth the wait.


  1. i want to know one thing web part are deployed....
    where can i check this deployed web parts into our moss 2007 sever...?

  2. After the blueprint is ready, some members of the developer's team will write the code and implement the design for your website. After that is the deployment process followed by the submission of the project.
    learn more

  3. A few organizations utilize free site formats for their organizations. Be that as it may, will a free layout help your organization radiate polished skill to your clients and focused on clients? Will that layout have all the extravagant accessories you require to make your site valuable and practical? Professional graphic design