Introduction
This Post highlights some of the business problems that was being faced earlier by our team while developing SharePoint based solutions and how various features of Visual Studio 2012 helped resolved those issues.
Problem Statement
What we have is a customized product based on SharePoint 2010 platform. Initially earlier versions of Visual Studios were used for the customization along with SharePoint Designer 2010 and Browser based changes. Due to these multiple issues used to come during development, testing and deployment.
Creation of Data Structures
Since normally any development around SharePoint requires some data structures (Lists/Libraries etc.) to be there. It used to take a lot of time and efforts to first get the required structure in place for all developers and worst part was to keep all of those in sync with any changes, in case one developer had to add/modify any structure.
Custom SQL Data Structures
Since our custom application hosts many custom applications as well, which communicate with custom SQL databases. Maintaining these structures within TFS was complex as earlier version of Visual Studio didn’t provide full fledge support for the same.
Visual Studio Solution Compatibility
Once of the major reasons for slow acceptance and migration to newer version of VS was that the solutions developed with newer versions were seldom compatible with older versions and either all or none of the developers could migrate to newer versions.
Limited Support for JavaScript Editor
With every sprint, we use more and more Java Script to make pages more responsive and take advantage of client side computing to the extent possible. VS 2010 had limited support which required a lot of efforts to put in such a solution.
Visual Web Parts as Full Trust Solution Only
One of the major features of Visual Studio 2010 was a template for developing Visual Web Parts that allowed us to move away from troublesome SmartParts used in earlier version of SharePoint. However, there was also a major limitation of that template that required Visual Web Parts could only be deployed as a Full Trust Farm solution and not as a Sandbox solution that can run in a separate process without impacting the farm. That limited our options to have extended development teams for specific site collections, as development of web parts is comparably complex.
Deployment
Once the customized solutions were developed, putting them on integration, UAT and then Production environment was time consuming and error prone. Since because of limited support for SharePoint, Visual 2010 didn’t have the capability of package everything (ok, not without putting some good effrots), it was required to deploy such changes manually.
Solution Needed
To save some good amount of efforts and streamline deployment processes it was required to have a tool that could help us overcome the issues mentioned above.
Creation of Data Structures
It was required to create all the SharePoint Data Structures at once with the ability to deploy those as a package to all other development machines with changes being tracked and re-deploy options.
Custom SQL Data Structures
It was required to have a template that can be used to create SQL data structures from within the development environment that is also integrated with the source control for tracking, maintaining & deploying changes.
Solution Compatibility
It would have helped us plan the migration to newer versions of development environment if the newer version supported solutions build on older ones and is compatible with them.
Enhanced Support for JavaScript Editor
A development environment was desirable to help the development with complex JavaScripts with intellisense, debugging, auto indenting etc. to expedite development and save valuable efforts from non-doing production work.
Visual Web Parts as Partial Trust Solution
Though there were some codeplex extensions available that could help deploy a visual web part as sandbox solution, a completely integrated and supported way was desirable.
Deployment
Only if we could package every change without much efforts, we could streamline the deployment process and manage changes effectively. This becomes more critical where development includes some SharePoint templates like Web/Lists/Libraries etc. Also, generating wsps out of multiple solutions was a big challenge and it was desired it we could publish all the wsps at one location in a single step.
How Visual Studio 2012 Helped
Visual Studio 2012 came with a lot of refreshing features that helped us resolve some of above mentioned issues quickly along with providing some additional features for faster development.
Creation of Data Structures
Visual Studio 2012 came with a great template that helped us with creating multiple List/Libraries definitions and instances in one go. We could add various types of columns and content types using a developer friendly interface and modify advance filed properties using the schema xml. We could package everything right from the VS 2012 interface and deploy as a wsp. However, a few things still require some enhancements like addition on Managed Metadata type columns, which is currently naïve and error prone and some modifications that require xml changes.
Custom SQL Data Structures
Even though there was a SQL Database Project type template available with VS 2010 as well, it lacked the graphical user interface required for quickly creating tables with complete structure. VS 2012 came with a completely new Database Project Type (though not compatible with VS 2010), it allows all the table structure to be created using familiar SQL server type interface along with the capabilities to put everything tables, SPs, Functions, Triggers etc. in one place, integrated with TFS and provide full build (detects any syntax errors and compiles) and remote publish. That also supports incremental deployment by deploying only the changes to any local/remote SQL Server.
Solution Compatibility
It came as a surprise that any new solution developed with VS 2012 can also be opened and worked upon with VS 2010 with SP1. It helped a lot during development as some of the developers started using VS 2012 whereas others were still using VS 2010 SP1 and still managed to develop everything in a seamless way (except the new database template).
Enhanced Support for JavaScript Editor
The new VS 2012 came with a pack of features for improved development with JavaScripts. Some of the features we got benefitted with –
- · IntelliSense for function overloads and variables
- · Smart indenting, brace matching, and outlining when you write code
- · A breakpoint within a single line of code
- · IntelliSense extensibility mechanism automatically provides IntelliSense when we use standard comment tags (//).
Visual Web Parts as Sandbox Solution as well
The new template to create any visual web part now seems to have integrated the codeplex solution and can now be deployed as a sandbox solution as well along with full trust Farm solution. This opens up a new window of opportunity for us to have extended engagement/project based development teams doing development without adversely impacting the entire farm or having any dependencies on the core development team for the deployment.
Deployment
SharePoint specific packaging seems to have got some good improvements where we were able to package almost everything with comparably much lesser efforts as compared to the earlier version. Also, even some small improvement like publishing all the wsps at one either directly to a SharePoint site as a sandbox solution or to a location in the file system helped us package quickly for further deployments.
Efforts Saved
The following table highlights the amount of efforts saved due to use of the features mentioned above in quantitative terms.
Feature
|
Efforts saved in one sprint (approx. 4-5 weeks)
|
Comments
|
Creation of Data Structures
|
40 hrs.
|
As against creating around 10-12 Lists/Libraries/Pages by each of the 6 developers and managing the changes.
|
Custom SQL Data Structures
|
30 hrs.
|
As against creating around 10-12 Tables and 25-30 SPs by each of the 6 developers and managing the changes.
|
Solution Compatibility
|
40 hrs.
|
Efforts saved due to able to work with VS 2010 SP1 on solutions created with VS 2012. If we had to update all the developers’ machines to VS 2012, it would have taken that many hours to clean up their machines, and get VS 2012 installed on each one.
|
Enhanced Support for Java Scripts
|
25 hrs.
|
The efforts saved was mainly due to great editor for writing scripts and easy debugging support.
|
Visual Web Parts as Sandbox Solutions
|
0 hrs.
|
Since visual web parts were not deployed as sandbox solutions in our case, the actual efforts saved is not reflected. However, this could be in tunes of 100s of hours if we consider the work that can now be delegated to individual project teams for their team site/engagement specific developments without impacting the integrity and performance of entire the product.
|
Packaging and Deployment
|
50 hrs.
|
Since all the manual steps could be removed by being able to package everything as wsp packages, deploying to Integration, UAT and finally on Production has become a few hours tasks (and less error prone) instead of days. The efforts saved would be much more (by at-least 20-25 hrs.) if the efforts for validating the deployments is also considered.
|
What Next
In addition to the features mentioned in earlier sections VS 2012 seems to have got some great features for Automating and Debugging Builds, which we are looking forward to explore in near future. Along with these, we intent to explore the features mentioned below which are new/enhanced in VS 2012 for SharePoint –
Creating Silverlight Web Parts
The new Silverlight Web Part project template makes hosting a Silverlight application in a web part easier and more convenient. The project template enables to create a new Silverlight application or provide our own, and it also provides a web part project with which to associate the Silverlight application
Publish SharePoint Solutions to Remote SharePoint Servers
In addition to deploying SharePoint solutions to a local SharePoint site, we can now publish SharePoint solutions to remote SharePoint sites
Test SharePoint Performance by Using Profiling Tools
The Visual Studio SharePoint tools now provide full support for performance profiling. The profiling tools help us identify code and other elements in your SharePoint projects that slow down and adversely affect the performance of our SharePoint applications
Test Code by Using Microsoft Fakes Framework
SharePoint projects support Microsoft Fakes, which is an isolation framework in which we can create delegate-based test stubs and shims in .NET Framework applications. By creating these stubs and shims, we can isolate our unit tests from the environment while you test your code.