Thursday, 7 April 2011

CKSDev My Favourite Features

Overview:  I love the codeplex project CKSDev.  This is the Community Kit for SharePoint 2010 - Developer Tools, it allows me to perform a lot of my tasks within Visual Studio 2010, it has a lot of templates I need and it has great local devlopment environment deployment tools.

Initial Hypothesis:  I estimate that I use 20% of the tools 80% of the time.  In this post I'm looking at what I use and like CKSDev to do for me.  The most important features for me revolve arround deployment.

Features
1) Deploy code quickly - I use to use WSPBuilder for MOSS, all the features and more are now part of CKSDev.  You can deploy code, reset IIS, deploy to the root hive, all faster than do a full deployment from VS.
2) Turn on the Developer Dashboard - OK I run Powershell to turn on my dashboard but it can be done easily using CKSDev.  Using Solution explorer navigate to the Site collection, right click and select "Developer Dashboard", I set mine to "On Demand".
3) Sandbox templates - Ok CKSDev use to include an SPI template for Sandboxed Visual Web Parts, this has been retired and I now use the "Power Tools for SharePoint 2010" (VSIX).  The full trust proxy SPI template is needed to log my Sandbox solution exceptions.
4) Other SPI templates - branding, master pages, Custom Actions, SPMetal... a lot of useful templates.
5) SharePoint Reference Tab - I dislike having to navigate to find the SharePoint dll's when adding references to my projects.  CKSDev add a new "SharePoint" references tab.
6) Discovery/Explorer - Using the solutions explorer when CKSDev is installed I get to see more artifacts from the Site Collection.

Summary:  I highly recommend using CKSDev, it speeds up development for SharePoint 2010 developers considerably.

Tuesday, 5 April 2011

Timesheet for SharePoint 2010 CodePlex project

Overview:  I have a lot of people looking for a timesheet solution for SharePoint 2010 as I have 4 posts on this blog about timesheets for SharePoint.  I get some great pointers and requests so I think it is time to make this a codeplex project.
Objective: To make a plug-in for SharePoint that will allow users to fill in timesheets.  I recon a sandbox solution is a good idea with SharePoint Online on the horizon in the next few months.  I want to provide 2 storage providers for the data: SQL Server and AZURE.
Wanted: As a starting poing I am going to add my code onto CodePlex in the next week and hopefully some folks want to build this as a community project.  If you are interested in helping out please drop me a line.  I need C# coders & front-end devs (someone to be in charge of the UI would be great), testers, documenters, ideas.  So if you want to join the project you can twitter me at @paulbeck1 and I'll add you to the codeplex project pre-launch.
http://twitter.com/#!/PaulBeck1
Part 1 - Design & data storage
Part 2 - Building the UI
Part 3 - Installation Steps
Part 4 - Final Part

Saturday, 2 April 2011

Changing Password setting in AD using Group Policy

Problem: On my development machines i often don't want to have to change my password every 42 days or adhere to the default group policy setting for password when using AD.  I have multiple VM on multiple domains and changing passwords is a hassle.

Initial Hypothesis: Passwords are normally lost in one of three ways:
1) data breach
2) social engineering or phishing
3) malware
The following group policy helps open a machine in a dev environment but are obviously bad practice:
Change group policy to not change the default password after X days, disable password complexity, and remove password history.  Also allow users to change passwords immediately.  Use the Group Management Policy Editor on the AD machine.

Resolution:
Start > Run... > gpmc.msc
Navigate to the domain you wish to amend the group policy for (in my case it is demo.dev)
Right Click the default Group Policy as shown below and select "Edit"


Navigate Computer Configuration > Policies > Windows Settings > Security Settings > Account Policies > Password Policy.
Edit the Password Policy as you want it.
Save & Close the windows.
Run the windows command prompt (dos prompt): cmd>gpupdate

Monday, 28 March 2011

What Browsers do SharePoint People use

I was looking at the stats from this blog of browsers that visitors used in March 2011, below is a summary:
 BrowserPercent
 IE 841.23%
 FireFox 317.59%
Chrome 1011.58%
 IE 97.96%
 IE 77.27%
 Chrome 95.76%


The most amazing stat was I had 1 visitor using IE4 at least that what their http header provided :)

Update 2 May 2011 - Browsers visting this blog breakdown for last week in April 2011.

Sunday, 27 March 2011

SPMetal Jbg Presentation evening

Thank-you to everyone that came to the presentation and Singular who sponsored the event.  I enjoyed doing the 2 sessions and meeting some new SharePoint folk.

Slide decks:

Session 1 - PowerPoint SP2010 Data Access (includes the introduction to LINQ to SharePoint)
Session 2 - PowerPoint presentation on LINQ to SharePoint with the demo

I'll record the slides and if i can get the presentation to a reasonable size I'll add the downloads here - more info to follow.

Code Download:
VS2010 solution - This solution contains 3 projects with the code used for this presentation.
  1. SPDemoLists - Pragmatically deploy the Customers and Order lists with a list lookup and populate the 2 lists with seed data.  Sandbox solution.
  2. SPDemoUI - C# sandbox solution that contains a visual user control (web part) that allows a customer to be selected in a drop down and then display the related orders for that customer.  Additionally there is a button to delete the selected customer. 
  3. SPDemonUnit - is an NUnit blank C# project setup ready to start adding unit tests.
SharePoint 2010 Johannesburg Knowledge Group Meeting Post
Event details: http://sp2010jbg.eventbrite.com/
Session summary's
Session 1
Presentation - Overview of data access in SharePoint. What are your options? Is SharePoint storage always the answer? What is LINQ to SharePoint? What is LINQ to SharePoint not good at? The 8 caveats to LINQ to SharePoint.
Session 2
Demonstrate LINQ to SharePoint 2010. Using Visual Studio creating a visual web part to perform CRUD operations on SharePoint lists.

Saturday, 26 March 2011

Cannot delete related SP2010 lists

Problem: You cannot delete either of 2 lists if they are related through a lookup column.  I tried deleting the list instances using Powershell and the SP2010 UI.  The List definition and corresponding content types are being deployed and retracted successfully.  PS error message when deleting either list instance is:
Exception calling "Delete" with "0" argument(s): "This list cannot be deleted because one or more lists are related to it. A relationship between two lists occurs when one of the lists contains a lookup column enforcing a relationship behavior on the other list."
 
Initial Hypothesis:  As I am deploying my lists using content types and there is a lookup column, it is important that they are created in the appropriate order.  As I am chaning my features elements manifest file building out my lists it appears to be that I have got my lists instances tangled so they can't be deleted. 

Resolution: I deployed my solution so that the CT and list definitions were present, I deleted the lookup column using the list setting in the UI.  I could then delete the list instances. 

Friday, 25 March 2011

SPMetal - Specified cast is not valid

Problem:  I am using LINQ to SharePoint to retrieve data.  A specific SPMetal list request generates the error "Specified cast is not valid".  Additional error information shown in the UI:
Web Part Error: Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred.
From the stack trace:
"at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.SharePoint.UserCode.SPUserCodeWorkerProcess.ExecuteDelegate.EndInvoke(IAsyncResult result)"
Hypothesis: The error message is a standard error thrown in a SharePoint sandbox solution. The underlying issue is that the proxy is working on lists using SPMetal however only 1 list is causing the problem.  I remembered that I had altered the list using Powershell.   Obviously the entity proxy class generated is based on the old list.  Generate the proxy with the latest lists.
Resoultion: Run SPMetal again to correct the proxy code as the proxy classes do not match the backend SharePoint lists.