.NET Reflector V6 Released

by Alex Meyer-Gleaves 16 February 2010 - 1:14 PM

Reflector Logo With this latest release of the recently acquired Reflector tool, Red Gate have provided both free and paid versions. The free version only has a couple of new features, the first of which was already available in the TestDriven.NET add-in for Visual Studio:

  • Jump straight to .NET Reflector from Visual Studio
  • Support for .NET 4 assemblies

Red Gate have decided to bundle a trial of the paid version along with the free one. Even though they are still releasing a free version, I find the forced bundling of the trial a little annoying. They are certainly trying to sell this as a good thing on their website:

image

The paid version, marketed as .NET Reflector Pro, is actually a Visual Studio add-in and offers some additional features:

  • Integrates the power of .NET Reflector into Visual Studio
  • Decompile third-party assemblies from within VS
  • Step through decompiled assemblies and use all the debugging techniques you would use on your own code

These certainly are very cool features, but ones that I would like to be given the option of trailing. Regardless, at the end of the day Reflector is still free, and still rocks!

Tags:

Categories: Development Tools

More than 1000 downloads for WSCF.blue V1

by Alex Meyer-Gleaves 5 January 2010 - 12:41 AM

On the last day of September in 2009 we released the first version of WSCF.blue on CodePlex. I was very pleased to see that there has now been more than 1000 downloads of the V1 release. Congratulations to the team and thank you to everyone who has downloaded WSCF.blue. It is great to see that interest in contract-fist development is still alive and well. Of course, Christian and Buddhike did a great job of spreading the word with their excellent MSDN article.

image

Now that everyone is back from holidays and feeling refreshed there is no doubt work will continue on the next version. We all have plenty of ideas for the features we would like to see, but what we would really like is feedback from the community on what you want. If you have ideas on what you would like to see in future versions of WSCF.blue please jump onto the forum and let us know.

Tags:

Categories: WSCF | Web Services | Development Tools

ReSharper 5.0 Beta available

by Alex Meyer-Gleaves 23 December 2009 - 12:24 PM

JetBrains has provided developers with an early Christmas present releasing the ReSharper 5.0 Beta on Christmas Eve. It looks there are plenty of new features to take for a test drive.

ReSharper 5.0 Beta introduces a great web development feature set; code analysis extended with call tracking, value tracking, and foreach-to-LINQ transformations; project-level refactorings; and a lot more enjoyable features.

The Beta version will work with both Visual Studio 2010 and Visual Studio 2008, although according to this post from JetBrains there are a number of known issues causing problems with support for Visual Studio 2010 Beta 2.

However, keep in mind that Visual Studio 2010 Beta 2 has a number of known issues that in certain scenarios prevent ReSharper from working well. Don’t worry too much though: it doesn’t mean your Visual Studio crashes every time you press Alt+Enter! JetBrains and Microsoft engineers are aware of the problems and working together to solve them by the time Visual Studio 2010 goes RTM.

Head on over to the What's New in ReSharper 5.0 Beta page for a download link and more information on the new features.

Tags:

Categories: Development Tools

Free database goodness: LightSpeed Express and SQLite

by Alex Meyer-Gleaves 17 November 2009 - 11:24 PM

I have used VistaDB Express for many hobby projects in the past and found it to be simple and reliable. This blog is running on VistaDB Express and it has never given me any trouble. Unfortunately, with the release of VistaDB 4 there will no longer be a free edition available for any purpose. While this is very disappointing I can understand why they have taken this stance.

Sorry, we had to discontinue the free edition of VistaDB due to the support demands, and the number of companies who were using it for commercial purposes.  We have to put food on the table and feed our families just like anyone else, this was the free as in beer problem (it cost us a lot to build and support, but people used it to make money and not pay us).

When it comes to small hobbyist projects this is not the end of the world, as there are other free products available that will meet such needs. I made the jump over to SQLite, another very popular and free embedded database engine. The main reason I chose to use VistaDB Express over SQLite in the past, was the fact that it had a wider range of supported data types and good management tools provided out of the box. However, there is a free management tool for SQLite called SQLite Database Browser that does a good job, and when used with a decent ORM the reduced number of supported data types in SQLite is soon forgotten.

image I have been using LightSpeed Express from Mindscape as the ORM atop of both database engines, and I must say that I absolutely love it. This free edition is limited to creating a model with at most eight classes, which I have found to be enough when coding for fun. If you don’t need many entities in your model it is well worth using given the features it provides. To see how the LightSpeed feature set stacks up against other ORM technologies including LINQ to SQL and LINQ to Entities have a read of the comparison document on the Mindscape website. LINQ to LightSpeed is the standout feature that makes this framework a winner for me. It enables you to use LINQ against any of the databases that LightSpeed supports: SQL Server, Oracle, PostgreSQL, MySQL, SQLite, VistaDB, Firebird and Amazon SimpleDB.

LightSpeed has an editor for Visual Studio that allows you to build your model in a manner similar to that provided by LINQ to SQL and LINQ to Entities. You can even use the design time tools to create a new database from an existing one. This is exactly what I did when moving an existing project from VistaDB Express to SQLite.

The LightSpeed designer extends that portability to design time. By changing the connection string and data provider on a model, and choosing Update Database, you can rapidly create much of your schema on the new database, rather than having to manually translate the SQL CREATE scripts from one dialect to another.

Once you have a good ORM in place you tend not to worry so much about the underlying database engine, well at least when your requirements are simple and you have no desire to spend money. This was certainly the case for me with VistaDB Express and SQLite. It would be interesting to know how many other VistaDB Express users have switched to a completely different database engine for their home projects despite the low price of the entry level VistaDB 4 Lite version. Regardless, I can assure you that LightSpeed Express will make any database engine you choose easier to work with, and like any good ORM will allow you to more easily change it at a later point in time.

Tags: ,

Categories: Database | Development Tools

Comparison keyboard shortcuts for Pending Changes in TFS

by Alex Meyer-Gleaves 5 September 2009 - 1:01 AM

Logitech MX5500 One of the first things I configured in my Visual Studio environment when I starting using TFS was keyboard shortcuts to make comparing my pending changes easier. I find having to right-click on each item in the Pending Changes window and navigate through the context menu to perform a comparison quickly tests my patience. The drop down menu on the tool bar button is slightly faster but still not quick enough for my liking. I am always fastest when my hands don’t need to leave the keyboard.

I have configured keyboard shortcuts to compare my pending changes with the Latest, Workspace and Previous versions. Obviously the shortcuts only work when the option would normally appear enabled on the context menu. To configure these shortcuts select Options from the Tools menu in Visual Studio. In the Options dialog use the tree to drill into Environment and then to the Keyboard settings. Enter the command names below into the Show commands containing text box one at a time:

  • TeamFoundationContextMenus.SourceControlPendingChangesSourceFiles.Compare.TfsContextPendingCheckinsCompareWithLatestVersion
  • TeamFoundationContextMenus.SourceControlPendingChangesSourceFiles.Compare.TfsContextPendingCheckinsCompareWithWorkspaceVersion
  • TeamFoundationContextMenus.SourceControlPendingChangesSourceFiles.Compare.TfsContextPendingCheckinsCompareWithPreviousVersion

For each command enter your desired keyboard shortcut into the Press shortcut keys text box and click the Assign button. I have used the shortcut keys below, assigned to the commands in the same ordinal position above:

  • Ctrl+`
  • Ctrl+Shift+`
  • Ctrl+Alt+`

With this in place I can quickly fire up and navigate through my diffs in WinMerge using only my keyboard. No mucking about and no reaching for the mouse. Even a simple set of steps can become frustrating when you have to repeat them a large number of times. Save yourself all that clunky mouse based GUI interaction and embrace the power of the keyboard!

Tags: ,

Categories: Development Tools

ReSharper 4.5.1 Maintenance Release

by Alex Meyer-Gleaves 26 July 2009 - 12:22 AM

image JetBrains have made a 4.5.1 maintenance release of ReSharper available for download. It is a free upgrade from any 4.x version, and the Release Notes indicate that a large number of bugs have been addressed. Despite some issues I had with the Beta version I happily found the 4.5 release to be stable. I have been regularly testing the nightly builds and think that 4.5.1 will be a stable and reliable release.

A couple of highlights for me are that the default Naming Style rules have certainly been improved, with more options available for both private and non-private accessible members. Also, method names with an underscore are no longer considered erroneous, which was a problem for auto-generated event handlers in Visual Studio. It was also a problem if your unit test naming convention involves the use of underscores as a separator, like this one recommended by Roy Osherove.

Tags:

Categories: Development Tools

WSCF.blue Beta Released: Are you doing contract-first?

by Alex Meyer-Gleaves 5 July 2009 - 4:56 PM

WSCF WSCF.blue is a Visual Studio Add-in designed to bring the benefits of contract-first web service development to those working with WCF (Windows Communication Foundation). I recently joined the WSCF.blue project and have enjoyed working with a team of very talented developers. Please be sure to read their blogs and benefit from the experience they offer:

My first foray into the world of contract-first web service development was made all the more pleasurable thanks to the WSCF (Web Service Contract First) tool. This early version of WSCF was targeted at web services developed using ASMX, and was first released by thinktecture, where it was maintained by team members Christian Weyer and Buddhike de Silva. The project later moved to CodePlex where it remains available today; although it has been renamed to WSCF.classic to differentiate it from the new WSCF.blue version designed for use with WCF. I highly recommend taking a look at WSCF.classic if you are developing web services using ASMX and are interesting in the contract-first approach.

For those currently working with WCF, or looking to migrate from ASMX, you will no doubt find WSCF.blue to be a must have tool. It fills a gap in the tooling available to .NET developers that want to embrace the contract-first approach in its true form. If you aren’t familiar with contract-first web service design I recommend reading the articles below. You will notice that the first of these articles was written by team member Christian Weyer (web services guru, co-founder of thinktecture and creator of WSCF):

The contract-first approach guides the developer of a web service into creating an interface (contract) that is interoperable and standards compliant. It requires a shift in focus, moving away from a code oriented perspective to one that is oriented towards data and messages. This type of thinking will greatly benefit those building SOA (Service Oriented Architecture) based systems. The XML Schema and WSDL (Web Services Description Language) specifications are key to achieving the goals of contract-first. These specifications may appear strange at first sight, but better understanding them will allow you to make your web services easier to consume, and more interoperable in the heterogeneous environments we frequently find ourselves forced to work within.

Below are posts from the other WSCF.blue team members regarding the Beta release:

Please download the Beta version, smack it around and put it through its paces. It is the development community that is best positioned to shape the future direction of WSCF.blue; so please provide your feedback, report bugs and help spread the word of contract-first.

Tags: , ,

Categories: WSCF | Web Services | Development Tools

Using REST in NAnt with a custom HTTP Task

by Alex Meyer-Gleaves 18 June 2009 - 12:42 AM

I needed to make HTTP requests to a REST web service from a NAnt script today so I knocked up a custom task. The HttpClient class from the WCF REST Starter Kit that I blogged about previously came in handy to offload most of the heavy lifting, leaving me to worry about the task related implementation details. The task supports all the HTTP methods and allows you to specify the content type and the content itself. You can also retrieve the response content and status code through properties set by the task. This was all achieved with surprisingly little code.

using System;
using System.Collections.Generic;
using System.Net;

using Microsoft.Http;

using NAnt.Core;
using NAnt.Core.Attributes;

namespace AlexMG.NAntTasks
{
    [TaskName("http")]
    public class HttpTask : Task
    {
        private static readonly List<HttpStatusCode> successCodes = new List<HttpStatusCode>
        {
            HttpStatusCode.OK,
            HttpStatusCode.Created,
            HttpStatusCode.Accepted,
            HttpStatusCode.NonAuthoritativeInformation,
            HttpStatusCode.NoContent,
            HttpStatusCode.ResetContent,
            HttpStatusCode.PartialContent
        };

        [TaskAttribute("url", Required = true)]
        [StringValidator(AllowEmpty = false)]
        public string Url { get; set; }

        [TaskAttribute("method", Required = false)]
        [StringValidator(AllowEmpty = true)]
        public string Method { get; set; }

        [TaskAttribute("content", Required = false)]
        [StringValidator(AllowEmpty = true)]
        public string Content { get; set; }

        [TaskAttribute("contenttype", Required = false)]
        [StringValidator(AllowEmpty = true)]
        public string ContentType { get; set; }

        [TaskAttribute("connectiontimeout", Required = false)]
        public int ConnectionTimeout { get; set; }

        [TaskAttribute("responseproperty", Required = false)]
        [StringValidator(AllowEmpty = true)]
        public string ResponseProperty { get; set; }

        [TaskAttribute("statuscodeproperty", Required = false)]
        [StringValidator(AllowEmpty = true)]
        public string StatusCodeProperty { get; set; }

        protected override void ExecuteTask()
        {
            HttpClient client = new HttpClient();
            HttpRequestMessage request = new HttpRequestMessage();

            if (!string.IsNullOrEmpty(Method))
            {
                request.Method = Method;
            }

            request.Uri = new Uri(Url);
            
            if (!string.IsNullOrEmpty(ContentType))
            {
                request.Headers.ContentType = ContentType;
            }

            if (!request.Method.Equals("GET", StringComparison.OrdinalIgnoreCase))
            {
                request.Content = (string.IsNullOrEmpty(Content)) ? HttpContent.CreateEmpty() : HttpContent.Create(Content);
                request.Headers.ContentLength = request.Content.GetLength();
            }
            
            if (ConnectionTimeout != 0)
            {
                client.TransportSettings.ConnectionTimeout = TimeSpan.FromSeconds(ConnectionTimeout);
            }

            Project.Log(Level.Info, "Executing HTTP request.");
            Project.Log(Level.Info, "Url: {0}", request.Uri);
            Project.Log(Level.Info, "Method: {0}", request.Method);
            Project.Log(Level.Info, "Content Type: {0}", request.Headers.ContentType);
            Project.Log(Level.Info, "Connection Timeout: {0}", client.TransportSettings.ConnectionTimeout);

            try
            {
                HttpResponseMessage response = client.Send(request);

                if (FailOnError)
                {
                    response.EnsureStatusIsSuccessful();    
                }

                if (!string.IsNullOrEmpty(StatusCodeProperty))
                {
                    Project.Properties[StatusCodeProperty] = response.StatusCode.ToString();
                }

                if (successCodes.Contains(response.StatusCode) && !string.IsNullOrEmpty(ResponseProperty))
                {
                    Project.Properties[ResponseProperty] = response.Content.ReadAsString();
                }

                Project.Log(Level.Info, "Received HTTP response.");
                Project.Log(Level.Info, "Status Code: {0}", response.StatusCode);
                Project.Log(Level.Info, "Content Type: {0}", response.Headers.ContentType);
            }
            catch (ArgumentOutOfRangeException ex)
            {
                string message = string.Format("The HTTP '{0}' request to '{1}' failed:{2}{3}", Method, Url, Environment.NewLine, ex.Message);
                throw new BuildException(message, ex);
            }
        }
    }
}

Using the task is simple. The only mandatory attribute is url and the default HTTP method is GET. Here is a sample NAnt project showing how to use the <http/> task.

<?xml version="1.0"?>
<project name="Http">
  <http url="http://www.howtocreate.co.uk/operaStuff/userjs/samplexml.xml"
        method="GET"
        contenttype="text/xml"
        connectiontimeout="30"
        responseproperty="response"
        statuscodeproperty="status"
        failonerror="true" />

  <echo message="Response: ${response}" />
  <echo message="Status Code: ${status}" />
</project>

I have attached the source code and task assembly below. The compiled assembly has the Microsoft.Http.dll assembly from the WCF REST Starter Kit merged into it using the ILMerge tool. This makes deployment easier by removing the chance of accidentally forgetting to deploy the dependency. If you are compiling from source code you will need to update the xcopy command in the post-build event to point to the location of your NAnt bin folder.

HttpNAnt Binary.zip (139.62 kb)

HttpNAnt Source.zip (1.06 mb)

Tags: , , ,

Categories: Garage Sale Code | Development Tools | Web Development | Web Services

PreCode Plugin for Windows Live Writer v4.0

by Alex Meyer-Gleaves 1 April 2009 - 8:52 PM

I use the PreCode plugin for Windows Live Writer to add the code snippets to my blog posts that are highlighted with SyntaxHighlighter. PreCode adds the HTML markup required for SyntaxHighlighter to identify the snippets that require highlighting. It also ensures that the snippet code is HTML encoded.

The recently released version of PreCode now includes support for the new SyntaxHighlighter v2.0 markup and options. The HTML that SyntaxHighlighter uses to identify code snippets was changed in v2.0 to be more standards compliant and is notably different to the old markup. For this reason, the plugin will not work with older versions of SyntaxHighlighter.

The UI of PreCode has also been given an update and is looking very nice indeed.

 The updated PreCode UI.

Another cool feature Anthony Bouch has added is the ability to run PreCode as a standalone Windows desktop application. Thanks to Anthony for keeping this great plugin alive and kicking.

Tags:

Categories: Development Tools

ASP.NET MVC RTM

by Alex Meyer-Gleaves 30 March 2009 - 8:53 PM

It looks like ASP.NET MVC 1.0 has been released and is available for download. Microsoft have been very open with the development of MVC and have really taken community feedback on board. The end result of taking this transparent approach speaks for itself.

Phil Haack from Microsoft has written about the release of MVC and I’m sure ScottGu will soon roll out another one of his monster blog posts. It will be interesting to see what Microsoft has in store for the next version of MVC.

Tags:

Categories: Development Tools | Web Development

About the author

Alex Meyer-Gleaves I'm a software developer living in Australia (that island like continent in the southern hemisphere). I love Microsoft .NET and C#. I hate early mornings, slow drivers and Lotus Notes.

Google Reader Clips

SpringWidgets
RSS Reader
This widget is the staple of our platform. Read all your feeds right here with thisone widget - Supported feeds are OPML, RSS, RDF, ATOM. Watch your favorite Podcastin the embedded Video Player on the Desktop or publish your own video playlist toyour site for others to view!

Recent Comments

Comment RSS

Links

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in  anyway.

© Copyright 2008