Archive for September 29, 2011

Charting WebPart

I’m in the process of writing a Charting WebPart for SharePoint 2010, specifically aimed at the standard version, which does not come with such a feature. Of course, it’s still usable within an enterprise environment if you were to find it useful.

Chart WebParts

To download the solution and installation script, follow this link.
Read more

Error Running SharePoint Unit Tests on 64 Bit Machine

System.IO.FileNotFoundException: The Web application at http://localhost could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application

If you get the above error while opening a site through an SPSite object while performing a unit test in Visual Studio 2010, a simple resolution is to update the test engine settings to run in a 64 bit process.

To do this, highlight the test project in the Solution Explorer and from the Test menu, select Edit Test Settings -> Local (local.testsettings).

Next, select Hosts from the left hand pane and change the Run tests in 32 bit or 64 bit process: to Run tests in 64 bit process on 64 bit machine.

Unified Logging Service Class

Looking for a simple class to add the ability to write to the Unified Logging Service (ULS) for your SharePoint 2010 project? Then the following should provide a good starting point for you.

Full source code for this example is available to download from here.

First things first, create a new class library project and add a class called Logger. Also add a couple of references to your project.

  • Microsoft.SharePoint
  • System.Web

Next, have your class inherit from the SharePoint class Microsoft.SharePoint.Administration.SPDiagnosticsServiceBase.

[System.Runtime.InteropServices.GuidAttribute("FBAF2022-DB19-4d2b-A029-948B747A4045")]
public class Logger : SPDiagnosticsServiceBase
{
}

Read more

Workflow Activity – Part 2

This is the second part of the custom workflow activity creation tutorial. For the first part please go here.

Now that we have a workflow activity defined, the next step is to add a new project to Visual Studio.

Create SharePoint Project


Read more

Workflow Activity – Part 1

The object of this post is to provide a walkthrough on creating a custom workflow activity for SharePoint 2010 and deploying it as part of a custom sequential workflow.

Start by creating a new empty Class Library project.

New Project


Read more

Follow

Get every new post delivered to your Inbox

Join other followers: