260 likes | 439 Views
SharePoint 2010 and Visual Studio 2010: The toolset we've been waiting for. Doug Perkes Senior Consultant Microsoft Services. Setting Expectations . . . This is not a “deep dive” into the extensions for Visual Studio Many other resources that can help you here
E N D
SharePoint 2010 and Visual Studio 2010: The toolset we've been waiting for Doug Perkes Senior Consultant Microsoft Services
Setting Expectations . . . • This is not a “deep dive” into the extensions for Visual Studio • Many other resources that can help you here • Unknown applicability of these extensions to your specific customer • My objective is to give you a taste of what is available and empower you with a foundation for doing SharePoint 2010 development
Agenda • Recap SharePoint Development Tools for Visual Studio 2010 • Setting up a development environment • Approaches to solution management / feature deployment • Debugging your code • Additional Resources • “Real World” scenario
SharePoint 2010 VS Projects • General Projects • Empty Project • Module • Business Data Catalog Model • Content Type • List Definition • Site Definition • Visual Web Part • Import SharePoint Solution Package • Workflow / Event Projects • State Machine Workflow (List or Site) • Event Receiver • Sequential Workflow • Import Reusable Workflow
SharePoint 2010 VS File Types • Application Page • Business Data Catalog Model • Business Data Catalog Resource Item • Content Type • Empty Element • Event Reciever • Global Resource File • List Definition • List Definition From Content Type • List Instance • Module • Sequential Workflow • State Machine Workflow • User Control • Visual Web Part • Web Part • Workflow Association Form • Workflow Initiation Form
Project Type / File Type Demo…
Development Environment • Build your own (BYO) • OS must be 64 bit (Windows Server 2008, Vista, or 7) • OS must be running IIS (Ultimate / Enterprise client versions) • Expect both hunger for memory and CPU cycles • For Beta bits, there are specific instructions for both VS 2010 and SharePoint 2010
BYO - Software • Required: • Visual Studio 2010 Professional / Team Edition • SharePoint Development Tools For Visual Studio 2010 • Some “local” SharePoint instance • Some “visible” SQL 2008 repository (To support the local SharePoint instance) • Recommended: • Source control system (TFS, Subversion, GIT, not Source Safe) • SharePoint Designer 2010 (Huh?)
Solutions and Features • SharePoint solutions / features ARE the way to get custom code into SharePoint 2010 • From a custom development perspective, huge improvements over SharePoint 2007, but beneath the covers much of the same • . . . But you may never have to manually touch a manifest.xml file or *.ddf file again
Solution / Feature Demo…
Custom Event Receivers and Feature Resources • Event receivers allow for custom code to be executed when a specific feature event is triggered (eg Activation, Deactivation, Upgrade) • Feature Resources are just *.RESX file(s) that are included with a feature • Just right click on the Feature within the VS Solution • Choose “Add Event Receiver” or “Add Feature Resource” • Visual Studio will stub out the files for you and wire them into the Solution / WSP
Debugging your code • Much better integration with Visual Studio than in previous versions • Just click “Debug” - More similar to the pure ASP.Net application experience • The “Developer Dashboard” (or the tool that you can’t believe you lived without)
How Debugging works . . . • Customized pre-deployment commands executed • WSP package created using MSBuild • If a full-trust SharePoint solution is full-trust, the IIS application pool for the specified site URL is recycled (To unlock and files in use by the IIS WP) • If the solution has already been deployed, the earlier instance is “cleaned up” (Features deactivated, solution uninstalled and then deleted.) • The new solution is added and then deployed • The feature(s) within the solution are activated if they are scoped to Site or Web. • Customized post-deployment commands executed • Visual Studio debugger attaches to the w3wp worker process your site is running under. For sandboxed solutions, the debugger will attach to the SPUCSPUCWorkerProcess. • Launches a browser window that navigates to the configured start location
Debugging Feature Receivers • Feature event receivers cannot be debugged using the “Debug” shortcut within VS 2010 • Activation is done in a separate process outside of the w3wp, so your breakpoints won’t get hit • Feature event receivers can be debugged by manually attaching to the w3wp and then manually activating a feature through the SharePoint UI • You will probably want to create a custom default deployment configuration that doesn’t activate your features
Debugging Demo…
Developer Dashboard • Summary View: • “Basic” event execution times • Shows summary information about the request, including the size of the working set associated with the request • Highlights all SharePoint database activities, including their execution times • Note that these are clickable for even more detailed analysis • Detail View: • Detailed “Stack trace” of the page request, with timings and categorizations • Shows the control hierarchy with unique id, object type, rendered bytes, viewstate size • Sections for Session state and application state variables • Request and Response cookies • Request and Response headers • Forms and Query string collections • Server variables
Activating the Dashboard • To turn on:stsadm –o setproperty –pn developer-dashboard –pv on • To turn off:stsadm –o setproperty –pn developer-dashboard –pv off • To turn on (conditionally):stsadm –o setproperty –pn developer-dashboard –pvondemand
Developer Dashboard Demo
Take Aways • SharePoint extensions for Visual Studio actually useful this time around • Simplify the generation of common SharePoint components • Much improved oversight of feature / solution development • Direct deployment provides for quicker dev – test - dev cycles • Debugging more consistent with what we are used to with ASP.Net • Fewer instances where we need to “Attach to W3WP” • Better OOB SharePoint assistance for developers. • Developer dashboard gives a lot of information – including performance data
Additional Resources • SDKs • Windows SharePoint Services • SharePoint Server 2010 • SharePoint Development Tools for Visual Studio 2010 • Free, In-depth training • SharePoint 2010 Developer course on MSDN’s Channel 9:http://channel9.msdn.com/learn/courses/SharePoint2010Developer/