SharePoint Audit Solution

I’ve written some code for SharePoint 2010 (is also possible to make work with SharePoint 2007) that allows users to view audit information relating to site, list and individual items.

I’ve also added the code to Codeplex, which you can download by clicking this link. The code in the project should be straight forward enough to follow and understand.

Basically, the project comprises of some layout pages which reuse a configurable user control to display auditing information within a paged grid control. Access to these pages is either via the edit control block (ECB) context menu or the ribbon interface.

Once deployed, activate the Item Level Auditing web feature.


Continue reading

Posted in SharePoint | Tagged , | 17 Comments

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.
Continue reading

Posted in SharePoint | Tagged , | 3 Comments

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.

Posted in SharePoint, Unit Tests | Tagged , | 2 Comments

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
{
}

Continue reading

Posted in SharePoint | Tagged , , | Leave a comment

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


Continue reading

Posted in SharePoint, Workflow | Tagged , , | 3 Comments