Downtime

Hi All, There will be some downtime on dwmkerr.com for the next 48 hours as I transfer the site and domain to another service.

Extending Visual Studio Part 1 - Code Snippets

I have published the first of a series of articles on extending Visual Studio on the CodeProject. Part 1 deals with Code Snippets, the article link is below, enjoy! http://www.codeproject.com/KB/dotnet/extendingvisualstudio1.aspx

How to Debug a Visual Studio Extension

Here are a few tips for debugging Visual Studio Extensions. Visual Studio 2008/2010 If you need to debug your Visual Studio extension, you may find that Visual Studio itself locks it. This is a real drag - to resolve this issue, add the following as a pre-build step: if exist "$(TargetPath).locked" del "$(TargetPath).locked" if not exist "$(TargetPath).locked" if exist "$(TargetPath)" move "$(TargetPath)" "$(TargetPath).locked" This will ensure the locked file is moved out of the way first - very useful!
Read more

Composite Data Service Framework on CodeProject

I have written an article on the CodeProject describing the Composite Data Service Framework project, the article is at: http://www.codeproject.com/KB/WCF/compdataserviceframework1.aspx Please have a look and get involved with suggestions via the 'Discuss' page of the CDSF homepage, http://cdsf.codeplex.com/.

Getting Source Code Metrics from SVN

Lets say that we need to find out how many lines of code exist in a branch, or how many lines are checked in by a specific user. Let's ignore the usefulness of these metrics, just assume that they're needed (realistically, lines of code isn't a very useful metric, but perhaps you want to have a quick idea of how much has gone into a release). How do we do this?
Read more

IDataServiceMetadataProvider Entities Missing in $metadata

If you are following through the example on creating custom data service providers as on this blog: http://blogs.msdn.com/b/alexj/archive/2010/01/08/creating-a-data-service-provider-part-3-metadata.aspx And you notice that your entities are not showing up in the $metadata file, double check that you have added this: public class service : MyNewDataService { // This method is called only once to initialize service-wide policies. public static void InitializeService(DataServiceConfiguration config) { config.SetEntitySetAccessRule("*", EntitySetRights.AllRead); config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; } } Just remember to set the entity set access rules for all entities - other they won't show up!
Read more

Composite Data Service Framework

Today I start a new project - the Composite Data Service Framework. The Composite Data Service Framework is a project that aims to obviate some of the limitations of WCF Data Services, specifically: Allowing multiple data services to be aggregated in a single data service. Providing more support for Service Operations (such as auto-generation of proxies client-side). Aggregating different service types (entity framework, CLR types etc) Complementing OData services with traditional WCF services with a single definition of proxies client-side.
Read more

Data Service Exception "Unauthorised" when connecting to Sharepoint OData

If you are struggling to fetch data from a Sharepoint OData service and getting an error as below: [DataServiceClientException: Unauthorized] System.Data.Services.Client.QueryResult.Execute() +436914 System.Data.Services.Client.DataServiceRequest.Execute(DataServiceContext context, QueryComponents queryComponents) +133  Then ensure you are setting the Credentials property of your Data Service Context, as below: // Create the data context. SharepointDataContext dc = new SharepointDataContext(new Uri("http://dksp/_vti_bin/listdata.svc")); // Provide default credentials, without this authorisation will fail! dc.Credentials = System.Net.CredentialCache.DefaultCredentials; // Etc… var accounts = from a in dc.
Read more

The "Name attribute is invalid" when adding a Service Reference to a Sharepoint OData Service

Well this little issue took me a while to investigate, but the skinny is this: If you are going to add a service reference to a Sharepoint OData service (e.g. http://sharepoint/_vti_bin/listdata.svc) then make sure your Sharepoint site name does NOT begin with a number - otherwise Visual Studio will fail to add the reference. Quick and easy, but this took quite a while for me to find, hope it helps anyone in the same situation!
Read more

Apex 1.2 Released

Apex 1.2 has been released, with some new features: The ‘Compatibility’ namespace, which contains classes to address compatibility issues between WPF, Silverlight and WP7. The ‘Asynchronous Command’ object, which provides a powerful way to use Asynchronous Commands in MVVM. The release is at: https://github.com/dwmkerr/apex