Office365 Preview Development – Using Visual Studio

n..continuing with the Office365 preview and development one of the most anticipated and my favorite feature is given by Visual Studio 2012, what is that? lets see
n
nlooking back at SharePoint 2010 and Visual Studio 2010 days – we were able to create the SharePoint projects using built in project templates given by VS for SP 2010 – but the disadvantage of using this project template was we had to install on the SharePoint on machine itself, we couldn’t just create the wsp project on local machine with VS 2010 installed and then deploy the wsp to the server.
n
nSo whats new now?
nWell with the visual studio 2012 RC – there is enhancement done for those who deal with Office365 / SharePoint 2013.  we can create a app project and deploy it on the OnPremise or on cloud SharePoint directly. just need to mention the site URL and we are done. visual studio takes care of deploying and installing the app package for you.
n
nOnce you install Visual Studio 2012 RC on your machine – install the Office Project Templates using this link. (download the tools under tools section). after this is done – you will be able to see the SharePoint project templates in VS 2012 RC.
n
nLets create a sample app project and deploy it directly on Office365 preview SharePoint site.
n
n

n

n
n
n Click ok, next step is to enter name URL of SharePoint site on which you want to deploy this app. now interesting point here is you can either add the url of your on premise SharePoint server site or add url of your Office365 site.
n
n

n

n
n
nagain – it asks you to select the type of deployment of your app. there are two types of SharePoint app deployment.
n
n1. SharePoint Hosted – everything remains in SharePoint , complete code runs on client.
n2. Cloud Hosted  – when app contains some server side code the this deployment type is selected.
n     this is again subdivided into two types
n         a. Developer hosted – app developer should bring his own deployment infrastructure.
n         b. Auto hosted – SharePoint takes care of deployment of package itself.
nFor more information – please take care of great video series by Andrew connel here.
n
nwe will select the SharePoint hosted app and click finish. VS 2012 RC opens up app editor.
nLets take a closer look at solution explorer which looks like this
n
n

n

n

n

nFeature – a default feature which takes care of provisioning app entities to SharePoint
nContent – application css file
nImages – app image
nPages – application’s default landing page
nScripts – application js file – all JavaScript files undergo this folder.
n
nThere is AppManifest.xml which contains app settings such as
n
n

n

n

n

n

n

n

n

n

n

n
nApp Title , Name , App Icon and App Default start page
n
nPermission Request – If there are certain resources of the site collection / service applications needs to be accessed by the app – it should be mentioned in the permission requests , when app will be installed – a permission request will be made by the app to the user.
n
nFeature Prerequisites – If app required certain feature of the web to be activated before its use then it is mentioned in feature prerequisites.
n
n

n

n
nwhen this app is run – you should see welcome message – displaying this welcome message is handled in a js file where ECMA script / JSOM for SharePoint is used to retrieve the user name of the current user.
n
n

n

n
nYou can add / modify the js as you wish and can start building and deploying your app on your office365 preview site.
n
nHave fun.
n
n
n
n

Leave a Comment