• behance
  • gitHub
  • google
  • linkedin
  • twitter
Debug – C# Express 2008

Debug – C# Express 2008

There is no doubt that C# is a great language, on top of that Microsoft have released some great IDE’s, and on top of that, some of them are FREE!  I recently considered going for a paid option as C# Express hasn’t got the full feature set of something like Visual Studio 2008 Professional (as you would expect).  The thing that I don’t understand is the rationale behind what features are taken out and what are kept for the free versions.  It seems almost arbitrary in some cases.

For instance if you right-click on a class code editor in VS2008 Pro you can see two nice options “Extract Method” and “Extract Interface”, in C# Express we only have “Extract Method” … go figure …

Anyway, one feature that really is needed and itsn’t available in C# Express is the ability to specify an external program to start when you hit debug.  If you making a composite app or are doing some unit testing with its own UI it helps greatly.  In VS2008 Pro you can simply go to the “Debug” tab on the Project Properties page and set this up.  In C# Express the Start option isn’t available, you are only presented with the “Command Line” box and bizzarely the “Working directory” selector.  You can however get around this by opening the .csproj.user file for the project you want to debug and enter in the Xml by hand. The code below is taken from a C# Express .csproj.user file for a set of tests I’m currently writing …

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>$(SolutionDir)Test_LibsxUnitxunit.gui.exe</StartProgram>
    <StartWorkingDirectory>$(SolutionDir)Test_LibsxUnit</StartWorkingDirectory>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <StartAction>Program</StartAction>
    <StartProgram>$(SolutionDir)Test_LibsxUnitxunit.gui.exe</StartProgram>
    <StartWorkingDirectory>$(SolutionDir)Test_LibsxUnit</StartWorkingDirectory>
  </PropertyGroup>

With this Xml placed inside the .csproj.user file I can now happily set my class library format project as the startup project in the solution and have it load the xUnit GUI whenever I hit Debug.

I do find this odd on Microsofts part. If C#Express is still capable of doing these things don’t arbitrarily remove the UI access to it and leave the functionality in the actual program. Oh well …

Leave a reply

*