Developing SharePoint solutions in CloudShare is really straightforward not only because you have a powerful environment for a testing and development them really fast, but also because it simplifies the process to deploy them to a real production environment. In this article I will show you how to develop and deploy a SharePoint WebPart from CloudShare to a SharePoint Online site in Office 365 by using the last version of the Microsoft IDE: Visual Studio 11 Beta.
- First, you need to access your CloudShare account and start one of your available environments.
- In this environment, you will need a virtual machine with all the development tools and platforms needed to create and deploy such SharePoint solution or artifact. Indeed, at least you will need:
- SharePoint Server 2010.
- Visual Studio 11 Beta.
You can start with one of the SharePoint 2010 virtual machine templates currently available at CloudShare and just install Visual Studio 11 Beta on it.
- Once you have your environment ready, just open Visual Studio 11 Beta. Create a new project just clicking on “File -> New Project”.
- On the “New Project” window, go to the SharePoint section under Visual C# project category. Click on the “2010” project templates and the select “SharePoint 2010 Project”. Provide a name for the project and the solution and click “Ok”.
- In the “SharePoint Customization Wizard” window specify your local SharePoint 2010 site for testing purposes, leave the deployment type as “Deploy as a sandboxed solution” and click “Finish”.
- Once the project creation process ends, you will see the complete project structure for your SharePoint solution in Visual Studio 11 Solution Explorer.
- Select the name of the project, do click with the right mouse button and press “Add -> Add New Item…”. In the “Add New Item” window, select the “Web Part template”, add a name to it and press the “Add” button.
- As you are creating a classic Web Part to be deployed in the Sandbox gallery in a SharePoint Online site, you’ll see at first the code editor ready to add some code to the Web Part.
- As an example, we will add some code to create a classic “Hello World” Web Part.
- Once you have coded the Web Part, just build it and prepare to publish it to the cloud. Again, do a click with the right mouse button and press the “Publish…” option.
- In the “Publish” window, specify the Url of the SharePoint Online site and press the “Publish” button.
- As you are publishing the Web Part to a SharePoint Online site, you’ll be asked to provide your Office 365 credentials.
- Once you are logged in Office 365, you can see how the Web Part is deployed to the SharePoint Online and the steps followed to accomplish it through the Visual Studio 11 Output window.
- When the deploying process ends, a browser session is opened with the Sandbox solution gallery of the destination SharePoint Online site. You’ll see there your Sandbox solution deployed and ready to be activated.
- Once you activate the solution, you’ll ready to select and use the Web Part packaged on it. You’ll find it in the “Custom” category inside the Web Part gallery.
- And here you go, you’ll have your sample Web Part ready and working on an Office 365 page in SharePoint Online.
And that’s all about how to deploy SharePoint artifacts from the cloud to the cloud by using Visual Studio 11. Happy CloudSharing! 🙂