Saturday, August 25, 2012

SharePoint 2013 Developer Tools

As we are in preview version there are couple of tools which are there to help developers to quickly complete their job. The new implementations in SP 2013 like Apps for office and Apps for SharePoint 2013 etc. are also a WSP package. They are also having the same structure as the general WSP packages we developed for 2010 environment.

‘Napa’ tools for Office 365 Development:

If you are having your SharePoint 2013 environment on the cloud then your life is so easy to develop the Apps. “Napa” Office 365 Development Tools provides you a great way to build apps for Office or SharePoint directly out of a browser windows.

You might be thinking now, are there need of Visual Studio or any other tools needs to be installed on the server? No, its not required. All you need is just Office 365 account and the latest browsers. You might need Visual Studio in case if you want to debug your app or writing any complex  code etc..

image

You can find more details about it on MSDN here.

SharePoint Developer Tools for Visual Studio 2012:

To develop SharePoint solutions in Visual Studio 2012 we must need these SharePoint developer tools. You can install them from here. Once you installed, you will see the new templates in Visual Studio for 2013 as shown.

image

SharePoint Designer 2013 and Visio 2013:

The SharePoint Designer is improved in many aspects. There are powerful implementations including ability to create .net 4.x workflows, new visual designer, loops [you can implement loop through items, wow.], calling web services, start workflow actions, packaging of workflows, dictionary [array] type variables etc.. So, IT guys can do much more than what they did compared to earlier versions without writing single line of code. It can address solutions to so many issues we had in earlier implementations with new SharePoint designer.

Visio 2013 also looks really cool and you can build powerful workflows and publish them with ease of development. Visio 2013 diagram now can connect to external data sources to use external data in the diagrams/workflows.

Wednesday, August 8, 2012

Install App for SharePoint Failed to install App for SharePoint

When I am trying to install the App this error encountered.

"Error occurred in deployment step 'Install App for SharePoint' Failed to install App for SharePoint"

Solution:
Please make sure the App Management Service and Subscription Service are running. To fix it, [You should need FARM administrator access]

From browser:
Go to Central Administration -> Services on Server and start both.

Through Powershell:
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance

Tuesday, August 7, 2012

Install App for SharePoint-There were errors when validating the App Package

While installing the App from Visual Studio 2012, I was getting the below error

"Error occurred in deployment step 'Install App for SharePoint' There were errors when validating the App Package"

And checked everything what could be the possible mistakes I have made. And couldn't able to figure out what was the issue. I have googled  and checked everything by going through all XML files and removed all content from the App project I have written. But, still no luck.

After 2 days, I am going through the MSDN articles on Apps documentation and found below information.

Ensure that your app manifest has an element instead of property. Otherwise, you might encounter this error when trying to deploy your app by using Visual Studio.

And another scenario you might get this error is due to app image. This information I found from internet that make sure the app image size should be 96 width and 96 height.

Sunday, August 5, 2012

Uninstall App for SharePoint' Value cannot be null. Parameter name value - Error occurred in deployment step

While working with SharePoint 2013 developing and deploying app you may see this error couple of times in the deployment process. From Visual Studio 2012  when you try to deploy the app from project properties and deploy option then the app will be deploys to SharePoint and install to the site given. In some cases, the app will be deployed but will not install correctly. In this case you have to retract and re-install the app again.

When you try to redeploy the app, it tries to retract the app and it fails with below error:

"Error occurred in deployment step 'Uninstall App for SharePoint' Value cannot be null. Parameter name value."

The solution is: from the "Site Contents" option of the SharePoint site, click remove from the App available options. If it is not successful then retry to remove the app again. It should be removed successfully this time. Now, try to redeploy again from Visual Studio. It should deploy fine with no issues.

Saturday, August 4, 2012

Outlook.com looks cool

Outlook.com the new email from Microsoft. The new features, UI everything looks very cool and nice. I personally feel I should recommend to everyone. Another advantage is you can link all Microsoft emails like hotmail.com, msn.com accounts to it. (Everything comes under one).

Try it today for yourname@outlook.com. Hurry. :)

SharePoint site is not developer site - SharePoint 2013 deployment error

This is the first error I got when tried to deploy my first app to SharePoint 2013 environment. Full details:

"Installation of app to SharePoint failed: SharePoint site is not a developer site."

This not giving any full details about why it is failing. Below are the things I verified to resolve the error.

  1. Please make sure the site is available from your developer environment [Where visual studio 2012 is installed]
  2. I have created my default site [when I created my SharePoint 2012 preview environment] as http://sp15 with publishing template. When tried to deploy this site it was failing. So, I thought of creating another site collection with different settings. When I go to Central Administration, create a new site collection, under Collaboration tab of create site page I found a new option named "Developer Site" template. So, I have created the site collection in the same web application with this template with the url http://sp15/sites/dev. This time I have tried to deploy the app to new SharePoint site and it was successful. 
I am not understanding why the issue is resolved as the developer site template did the trick? More information I will post in the same post soon. Do let me know if you have any more details.

Friday, August 3, 2012

Creating first SharePoint 2013 App

I was playing with SharePoint 2013 when preview was released and the first week gone through all UI, central administration features. After read the documentation, MSDN articles I was interesting to create my first SharePoint App.

Prerequisites:
  • We need Visual Studio 2012 to create your SharePoint 2013 App.
  • SharePoint Developer tools for Visual Studio 2012. If any else missing from installation install all from here like WIF SDK, Workflow Tools, Client Components etc..
  • Permissions to SharePoint site.
So, I have installed all of them and so enthusiastic to see my first app in SP2013. Created a new project in VS 2012 and selected my SharePoint 2013 site and SharePoint host App option. It's created below files as shown.

From project options [right click on solution or project, choose deploy] select deploy to deploy it to SharePoint site. It was not successful and end up with below errors in different trails. If you are getting anyone of the below errors please go through the related solutions and then proceed further steps.
Before you start developing App, the first thing we should do is, set up the environment for SharePoint Apps. This include below steps.
  1. Start SharePoint Administration Service and SharePoint timer Service. 
  2. Start App Manager Service and Subscription Settings Service.
  3. Create application pool for both services
  4. Associates the application pools to the services.
  5. Create database for each service to save the service specific information.
  6. Set appDomain for running apps.
  7. Set the app site subscription name [which comes as prefix in the app web url.]
Open the command prompt and execute the commands one by one to follow all the above 7 steps.
#Step 1
net start spadminv4
net start sptimerv4
#Step 2
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance
#Step 3
$account = Get-SPManagedAccount "domain\farm account"
$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
#Step 4 and 5
$appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
#Step 6
Set-SPAppDomain appdomain
#Step 7
Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
Note: The appDomain should be your application domain. Full qualified domain is preferable. And please make sure you are replacing the string "domain\farm account" with your actual farm account user.

If all the commands ran successfully without any issues then you are ready to create and deploy your first app to the SharePoint environment. Let me know if there are any issues.

Wednesday, August 1, 2012

SharePoint 2013 - Apps overview

Apps for SharePoint are self-contained pieces of functionality that extend the capabilities of a SharePoint website. Which means an App may include list, library, pages, workflow, a remote web application etc. The new Cloud App Model enable us to create Apps. Apps will be accessed from "Site Contents" page.

For example, we have to see every day the conversions from one currency to another currency for doing business then every time we have to go to web and open some site and then find the information. Instead if we have an App available to do this job of converting one currency to another currency mapping then we can simply do that inside the SharePoint site without going out of the site.

Important points to remember:
  • An app is a web application. So, if you know how to create a web application then you can create an App. It's that simple.
  • You can develop the app in any language you know like PHP, .NET, JavaScript, HTML etc.
  • App can connect any source like internal or external web services through ODATA protocol support in SharePoint 2013.
  • They can use REST [Representational State Transfer], client API's like JavaScript client API or .NET managed client API to integrate/connect app with SharePoint.
  • We can use all API's which SharePoint 2013 provides in Apps to read SharePoint data and utilize it to process the requirements. [Basically with ease of access we can read data from SharePoint and utilizing it in our App for different processing scenarios which is a huge advantage when compared to previous versions.]
  • The client.svc service we used in SharePoint 2010 for accessing the SharePoint data. Now, we don't need this to call client.svc end point and instead we can directly call the SharePoint 2013 service using the url /_api/ to read SharePoint data. For example, to call search service we can directly use /_api/search to call list data /_api/web/lists/ etc.
  • Using ASMX calls are deprecated.
Where can we host Apps?

1. SharePoint Store
SharePoint Store is owned and hosted by Microsoft. Developers can develop the custom apps around the world and can submit to SharePoint Store. So that any user can be able to download and install them. They can purchase apps if it is not free and buy licenses etc.

2. App Catalog
App Catalog is specific to any organization, where the apps are developed and owned by specific organization. It can be either on on-premises or SharePoint online hosted.

As I already mentioned each App will be a web application. SharePoint 2013 uses the App manifest metadata to identify the App and it will be registered to SharePoint. The sample manifest file will looks like below.
 
<?xml version="1.0" encoding="utf-8" ?>
<App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest"
     Name="My First SharePoint App"
     ProductID="{6c442cc4-0968-4f75-b664-2cbae5d5a6ca}"
     Version="1.0.0.0"
     SharePointMinVersion="15.0.0.0">
  <Properties>
    <Title>My First SharePoint App</Title>
    <StartPage>~appWebUrl/Pages/Default.aspx?{StandardTokens}</StartPage>
  </Properties>
  <AppPrincipal>
    <Internal />
  </AppPrincipal>
</App>
You can include authentication [app principles] and more details in the app manifest files. The string "StandardTokens" is replaced at run time to pass some context data like SharePoint language etc. See more details about App manifest here.

Apps hosting options
  • Cloud hosted: This type of hosting is used when app has at least one remote component. It may also include SharePoint hosted components. There are two types in Cloud hosted apps.
    • Provider-hosted: Apps for which the non-SharePoint components are deployed. Provider hosted apps can run on the cloud [SharePoint online] or on the own server [on-premises] depends on where you hosted them.
    • Autohosted: This will be used when apps that include Windows Azure web site, may has SQL Azure database. These apps will run in the cloud.
  • SharePoint hosted: Apps that include only SharePoint components and logic that runs on client. SharePoint hosted apps are hosted in SharePoint itself. The code we can use is HTML, JavaScript, CSS etc. When we deploy SharePoint hosted apps, SharePoint 2013 actually creates a web site in the site collection [to which you deployed] and is called as "App Web". The url of the App web is "prefix you register" + "-some random key from SharePoint"."full server qualified name/appname". For example: app-4c690ed122ce1f.sp15.corp.contoso.com/pages/default.aspx. This url is completely specific to the App and you can call it through API to read the App data.
I believe with this information, you can have clear idea on what are Apps in SharePoint 2013. Feel free to comment me if you have any questions or need more information.