1. Practical SharePoint for the .NET Developer
A Crash Course
John Calvert
SharePoint/Solution Architect
Software Craft Inc.
john at softwarecraft dot ca
at softwarecraft99
November 23rd, 2013
3. Thank you to my personal Sponsors!!
• http://www.cloudshare.com/
4. SharePoint Development
Technologies
Models
SharePoint APIs
Getting Started – Coding to SharePoint APIs
Diving in Deep – Coding inside SharePoint
Q&A / Evals
4
5. .NET / SharePoint solution architect
Over 18 years experience developing business
solutions for private industry & government
Recent clients include Justice, NRC, NSERC,
DFAIT, CFPSA, OSFI, MCC
Specialize in Microsoft technologies
5
8. Built on .NET 3.5.1, ASP.NET 3.5 , WF 3.5
IIS 7 and SQL Server 2008
Win 2008 or Win7, x64
8GB RAM single-server
.NET 3.5 for code calling SOM and code
deployed inside SharePoint
8
9. Built on .NET 4.5, ASP.NET 4.5, WF 4.5
IIS 7.5 and SQL Server 2008 R2
Windows Server 2008 R2, x64
12GB RAM in 3-tier farm, 24GB RAM single-server
(less if services disabled)
.NET 4.5 for coding calling SOM and code
deployed inside SharePoint
9
13. Any web or cloud IDE
“Napa” Cloud-Based Development
SharePoint Designer
HTML, CSS, JavaScript
Visual Studio
.NET, etc
PowerGUI or any PS command shell
PowerShell
13
14. oData / REST
http://localhost/_vti_bin/ListData.svc
http://localhost/_api/lists/
Client-Side Object Model (CSOM)
ClientContext.ExecuteQuery();
Server App Model
Server Object Model (SOM)
SPSite site = new SPSite("http://localhost/")
Web Services
http://localhost/_vti_bin/Lists.asmx
14
15. Using .NET, JavaScript, PHP, Ruby, etc
Address an oData / REST end point
Address CSOM .NET API
15
18. Using WPF/WCF, WinForms or Silverlight
Address an oData / REST end point
Address CSOM or SOM .NET API
18
19. using (ClientContext ctx = new ClientContext("http://loc
alhost/"))
{
Web web = ctx.Web;
ListCollection lists = web.Lists;
List list = web.Lists.GetByTitle(libraryname);
CamlQuery qry = new CamlQuery();
ListItemCollection items = list.GetItems(qry);
ctx.Load(items, li => li.Include(pi => pi["LinkFilename"
]));
ctx.ExecuteQuery();
return items;
}
19
20. using (SPSite site = new SPSite("http://localhost/"))
{
using (SPWeb web = site.RootWeb)
{
SPList list = web.Lists["Documents"];
SPListItemCollection items = list.Items;
return items;
}
}
20
21. Using .NET and HTML/CSS/JavaScript
Use webparts
Address SOM .NET API
Address an oData / REST end point
21
22. Coding
Visual Studio 11 improved item templates
Debugging
Synch & Asynch Processes
Attaching from Visual Studio (CKS DevTools)
Developer Dashboard
Logging
SPMonitoredScope
Deployment
Package (*.WSP) and Feature
PowerShell
22
23. Browser DOM Explorer
MSIE Developer Tools, etc
LINQ in & for SharePoint
Generate Classes with SPMetal
IEnumerable.Cast<>()
External Data
Business Connectivity Services
Reference Data
Managed Metadata vs BCS Code Tables vs Lists
23
24. Field names are not always what you think
Filename is LinkFilename
HKEY_CURRENT_USERSoftwareMicrosoft
VisualStudio11.0SharePointTools.
DWORD EnableDiagnostics=1
24
25. SharePoint 2013 development overview
(MSDN)
What’s new for developers in SharePoint 2013
Choose the right API set in SharePoint 2013
(MSDN)
Technical diagrams for SharePoint 2013
(TechNet)
25
26. Microsoft SharePoint Designer
CodePlex SharePoint Manager
Microsoft ULS Viewer
CKS DevTools
Microsoft SharePoint Online Code Analysis
Framework (MSOCAF)
LinqPad
PowerGUI
Notepad++ / Notepad++ Portable
26
27. Andrew Connell
Chris O’Brien – SharePoint Nuts and Bolts
Yaroslav Pentarskky – ShareMuch
Vlad Catrinescu – Absolute SharePoint
Peter Holpar – 2nd Life of Hungarian
SharePoint Geek
Secrets of SharePoint
SharePoint Developer Team (MSDN)
27
28. John Calvert
john at softwarecraft dot ca
at softwarecraft99
softwarecraft dot ca
Fill out eval forms => win great prizes
Draws after last session
28
29. Remember to fill out your evaluation forms to win some great prizes!
&
Join us for SharePint today!
Date & Time: Nov 23rd, 2013 @6:00 pm
Location: The Observatory Pub,
Algonquin Student’s Association
Address: A-170 on Algonquin Campus
Parking: No need to move your car!*
Site: http://www.algonquinsa.com/ob.aspx
Notas do Editor
At the end of the day, please ensure your evaluation is signed and handed in for door prizes. The draw takes place in Room 102A.
At the end of the day, please ensure your evaluation is signed and handed in for door prizes. The draw takes place in Room 102A.
Presentation assumes a basic knowledge of SharePoint
What kind of development are people doing:
ASP.NET MVC / Forms?
Web HTML5 / CSS / JavaScript?
Mobile Phone / Tablet?
.NET Services / Backend?
.NET Desktop?
How many people are using SharePoint today:
SharePoint 2010?
SharePoint 2013?
Neither?
How many people are developing for SharePoint today:
SharePoint 2010?
SharePoint 2013?
Neither?
SharePoint Development Platform Stack, http://msdn.microsoft.com/en-us/library/gg552610.aspx#SP14Architectures_platformstack
SharePoint 2010 Architectures Overview, http://msdn.microsoft.com/en-us/library/gg552610.aspx
Components of Business Connectivity Services, http://msdn.microsoft.com/en-us/library/jj163782.aspx#bkmk_Components
Business Connectivity Services in SharePoint 2013, http://msdn.microsoft.com/en-us/library/jj163782.aspx
Hardware and software requirements (SharePoint Server 2010) - http://technet.microsoft.com/en-us/library/cc262485(v=office.14).aspx
Windows 7 platform not an option for developers, unlike SharePoint 2010
Memory requirements are heavier, 12-16G with search, 24G with search
Hardware and software requirements for SharePoint 2013 - http://technet.microsoft.com/en-us/library/cc262485.aspx
TechSling - Things You Didn’t Know About SharePoint 2013 - http://www.techsling.com/2013/10/things-you-didnt-know-about-sharepoint-2013/
As a service : means code that calls SharePoint APIs but is not deployed in SharePoint.
As a framework : means code that is deployed inside or by SharePoint.
App Model is a special case, it is not deployed inside SharePoint but is deployed by SharePoint.
Not going to talk about App Model as there is another session on this topic, “An Introduction to Developing and Deploying Apps for Microsoft SharePoint and Office 2013” at 2:30pm in the Developer track
Find your project type in the unbolded black type to see what your choices are for SharePoint development
Choose the right API set in SharePoint 2013 - http://msdn.microsoft.com/en-us/library/jj164060.aspx
Microsoft “Napa” Office 365 Development Tools is a cloud-based development IDE for building Apps for MS Office or MS SharePoint
sign up for an Office 365 Developer Site
install Napa Office 365 Development Tools on your Office 365 Developer site
you are ready to create apps for Office documents, mail items or SharePoint
Won’t say any more about “Napa” or App Model as there is another session on this topic, “An Introduction to Developing and Deploying Apps for Microsoft SharePoint and Office 2013” at 2:30pm in the Developer track
Other IDEs:
Microsoft WebMatrix - http://www.microsoft.com/web/webmatrix/
Microsoft Lightswitch - http://msdn.microsoft.com/en-us/vstudio/ff796201.aspx
Any web or cloud dev IDE
Choose the right API set in SharePoint 2013 - http://msdn.microsoft.com/en-us/library/jj164060.aspx
Deprecated and not recommended:
ASP.NET (asmx) web services
direct Remote Procedure Calls (RPC) calls to the owssvr.dll file
SharePoint 2013 REST API, endpoints, and samples - http://msdn.microsoft.com/en-us/library/office/jj860569.aspx
Deployment and Admin: stsadm is deprecated but may occasionally be required
http://sps.cloudapp.net/
MSOCAF is intended for SharePoint Online app development, but it can also be used to analyze on premises solutions
MSOCAF code analysis covers:
exception management, memory management, object model usage, security vulnerabilities, deprecated / unsupported features, etc
MSOCAF combines the benefit of earlier tools
FxCop, CAT.Net, and SPDisposeCheck
LINQPad commercial Pro/Premium editions required for additional features:
Autocompletion, namespace and assembly resolution, snippets, NuGet integration, etc