Subscribe: Loren Halvorson's Blog
Added By: Feedage Forager Feedage Grade B rated
Language: English
color  compare  control  csharpcode  files  microsoft  net  new  report  set  studio  version  visual studio  visual  web 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Loren Halvorson's Blog

Loren Halvorson's Blog

If your only tool is a hammer...


Just released version 2.0.18 of XmlPreprocess

Wed, 31 Jul 2013 11:50:03 GMT

What's new in this release

  • For XML Spreadsheet 2003 format, used the frozen row at the top of the worksheet to indicate the beginning of the values. This prevents you from having to start your values at row 7. This can be overridden with the /firstValueRow (or /vr) argument.

Issues Fixed
  • Fix for Issue 13006 : Corrected default treatment of the value "false"

Beginning with this version, the FixFalse behavior that has caused confusion to so many, has hopefully been addressed in a way that still accommodates those who need backward compatibility.

The /FixFalse switch was introduced in Beta 1 to address issues caused when a settings has the value of False. When a value is False, the old behavior was to undefine the setting. This caused errors when you wanted to insert a literal "False" (a common value in configuration files). The workaround was to put the value in quotes, or pass the /f or /FixFalse switch.

There are now two executables in the binary package, one that breaks backward compatibility, and does the right thing by defaulting FixFalse to True (XmlPreprocess.exe), and one that maintains backward compatibility (XmlPreprocess-NoFixFalse.exe). Use the executable that is appropriate for your needs. If you are new to XmlPreprocess, most likely you're going to want to use XmlPreprocess.exe, and forget about the NoFixFalse version.

- XmlPreprocess.exe - This version defaults FixFalse to true, so you no longer need to pass it.
- XmlPreprocess-NoFixFalse.exe - This version is the old behavior. If you require the old behavior, feel free to rename this file to be XmlPreprocess.exe, and use it instead.

  • Fix for Issue 13009 : Fix for comments in Settings XML file.

Free T-SQL Formatter Updated

Tue, 19 Jul 2011 14:13:31 GMT

Tao Klerks has just released a new version (0.9.12) of the Poor Man’s T-SQL Formatter (I blogged about it last week) with several improvements and some more formatting options. He also set up a website so you can use it online  Thanks Tao, it keeps getting better!

Free T-SQL Formatter

Mon, 11 Jul 2011 15:34:39 GMT

If you are working on a project that has a lot of SQL code and wish you could reformat it to make it more readable, I just stumbled on a slick utility that is being developed in C# by Tao Klerks named Poor Man’s T-SQL Formatter.  It can be found here:  It’s not finished yet, but has enough functionality to be truly useful.  Tao tells me he is working on refactoring the code to make it more maintainable and adding more formatting options.

It has plug-ins for SQL Server Management Studio, and WinMerge, and a command line version that will allow you to integrate it into other tools like Beyond Compare thanks to a new -output command line option Tao recently added just for this purpose.


Here’s how I set it up for Beyond Compare 3:

In Beyond Compare 3, select the Tools | File Formats menu

Create a new Text Format named SQL Tidied

Mask: *.sql

Conversion: External program (Unicode filenames)

Loading: {path to PoorMansTSLFormatter}\SqlFormatter.exe -o "%t" "%s"

You probably want to move it in the list of formats to be just below the built-in SQL format so that it doesn’t get chosen automatically every time you compare SQL files.


Now you can compare two different SQL files after normalizing them to common “tidy” format which lets you see the true differences, and ignore unimportant ones like whitespace, wrapping etc.

Upgrading RDLC reports to Report Viewer 2010 in an ASP.NET web application

Wed, 20 Oct 2010 22:36:13 GMT

One of the web applications I am working on is an ASP.NET MVC 2 site targeting .NET 3.5 SP1 that uses the Microsoft Report Viewer control with local-mode RDLC reports. I initially developed this application using Visual Studio 2008. The client was OK if I started to use Visual Studio 2010, as long as I didn’t require .NET 4.0 just yet. The multi-targeting features of VS2010 were working great. I had started really enjoying VS 2010 and had no intention to go back to 2008. Then I needed to do some report work so I double clicked one of my RDLC files and was surprised to see this message box: Microsoft Visual Studio --------------------------- Microsoft Report Designer Do you want to convert this report to RDLC 2008 format?  Please click OK to proceed or Cancel to open it in the XML editor. My heart sunk and my blood ran cold. What have I done? I was afraid I would need to go back to VS 2008 just to keep the reports compatible with .NET 3.5! Fortunately, converting to the new Report Viewer control turned out to be OK (so far), but there were some surprises along the way. It’s all good (mostly) There are lots of nice new ajax, visual, and internal things about the new control but two of the highlights for me were: Compatible with .NET 3.5 SP1 and .NET 4.0 Looks better in more browsers Rendering is simplified and more standards compliant. I was able to put the strict DOCTYPE back in the page and (eventually) get resizing to work. More on resizing later. Upgrading The upgrading process was pretty straightforward. Install the Report Viewer 2010 Redistributable (This will need to be installed on any server to which you deploy). Convert RDLC files to new RDL 2008 schema. Simply opening the RDLC in Visual Studio 2010 converts to the new schema and automatically makes a backup. Change assembly reference to the new version of Microsoft.ReportViewer.WebForms.dll Change version number in assembly names in web.config You’ll see things in web.config that look similar to the following, make sure the version is Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A Change version number in any *.aspx pages that include the report viewer control registration <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"     Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> Include a ScriptManager on any *.aspx page that has a ReportViewer, or if you have a common master page that your reports share like I did, you can put it there, once for all. Some surprises that required rework The data sets must be flat. In some of my reports I took advantage of the fact that in the previous Report Viewer you could refer to properties of child objects. You used to be able to do this: =Fields!ChildObject.Value.ChildProperty Now the data set need to be flat.  This means that I needed to flatten out my domain objects by pulling properties from the child objects up to the parent object. This could have been a big problem, but luckily the way I had structured my code allowed me to fairly easily define a flat report object and bind to that instead. Getting the report to fill the browser with 100% height and resize dynamically was trickier than I hoped.  And this is the main reason I wanted to write this post. Making the report viewer resize I used the incredibly powerful jQuery.UI.Layout already in this site, so I just continued to use it on the report pages. The trick to getting the report control to resize properly in my case was to find the r[...]

TestDriven.NET 3.0 Released

Tue, 29 Jun 2010 15:16:46 GMT

I haven’t posted anything to my blog in a long time, but I wanted to point out that a product I truly love and use often has been updated. Jamie Cansdale has released TestDriven.NET 3.0, still one of my all-time favorite Visual Studio add-ons for low-friction unit testing.  Now it works with Visual Studio 2010, MSTest and tons of new features and refinements.

Here’s Jamie’s announcement

MSBuild trick for making calls more maintainable

Thu, 11 Dec 2008 19:52:37 GMT

One of my pet peeves with MSBuild’s task is how long the lines get when you have lots of arguments.

I ran across a trick yesterday in a blog comment made by someone named Romain and thought it was a very nice solution to this problem. When you expand items using this form @(items, ‘DELIMITER’), it allows you to specify a delimiter to use between the items. In the case of a command line, you use a space. Thanks Romain.


      WorkingDirectory="$(InstallDir)\Environments" />

Comparing XML Files with Beyond Compare 3...Brilliant

Wed, 19 Nov 2008 20:37:00 GMT

I bought a new laptop and was loading it with the tools I use every day. When it came to installing one of my favorites, Beyond Compare 2, I thought I'd check the Scooter web site to see if I had the latest version. I was happy to see they now had a version 3 with plenty of new features. I immediately reached for my credit card to buy a license. Folks, this is honestly one of the tools I don't even hesitate paying's that good, and that invaluable. I don't work for them, I'm just a very happy customer.

The base tool itself is great, but I was really thrilled when I followed the link on the Download page to Additional file format downloads for version 3.  There I found something I've been looking for years...and in fact a while ago had written a plug-in for BC2 to do...the ability to compare Tidied XML.

How many times have you tried to compare two dense XML files to find out their differences only to be faced with a block of differences that looks like this:


Beyond Compare notices that there are differences in there somewhere, but can't really show you where with any precision. Further inspection is going to be needed, and forget merging selected changes over from one side to the other.

If you install the XML Tidied and XML tidied with attributes sorted file formats, you can now tell Beyond Compare to tidy up your documents, putting each attribute on its own line, so the differences stand out. You can now see exactly which attributes differ. Absolutely brilliant.


This is a fantastic feature that's already saved me a bunch of time. I see there is a similar add-in for HTML tidied files that also will come in handy.

A couple of other features in Beyond Compare that I've come to rely on over the years:

  • Beyond Compare has great "low-friction" integration with Windows Explorer. For example to compare two files, you just right click on one file and choose "Select Left Side For Compare", then right click on the other file and say "Compare to {file...}".  This works for folders too.
  • Beyond Compare has great FTP integration. I use it to deploy changed files to FTP sites very painlessly.

I also see it supports doing 3-way merging from most version control systems. I haven't tried this yet, but I'm going to see how hard it is to plug into TFS.  If anyone has pointers on how to set this up, let me know.

 Update: Scooter's website shows how to set it up here

They have a 30 day trial, so if you aren't so sure, you can give it a try for a while. Highly recommended.

New Release of XmlPreprocess

Wed, 05 Nov 2008 18:55:09 GMT

I finally got around to updating the XmlPreprocess tool with some changes I'm really excited about. For those of you not familiar with XmlPreprocess, it's a command line tool I wrote many years ago that can modify specially annotated XML files much like a code preprocessor. It is useful for deploying XML configuration files to many environments. I've blogged about it in the past as have others, and it's achieved a fair amount of use (albeit hidden below the surface) in my good friend Scott Colestock's Biztalk deployment framework.

The first thing I did was move it to a CodePlex project which replaces the prior SourceForge project.


Changes in this release

  • New Codeplex home with updated documentation and samples.
  • Requires .NET 2.0 or newer runtime.
  • Adds the ability to import spreadsheets directly thanks to Tom Abraham's excellent work on the Environment Settings Manager project. This is a really nice feature, and I thank Tom for giving me permission to use his spreadsheet reading code.
  • Adds a command line switch (/f or /fixfalse) to fix the behavior of "False" values. This has been a long-standing request and tripped up many people for example here and here.  For the anguish and consternation this has caused to you all, I sincerely apologize, and hope you forgive me. If you want to explicitly undefine a property, use the value "#undef" instead.  (Note: that for backward compatibility, this behavior is off by default, and you will need to add the /f or /fixfalse switch to enable it).
  • Adds a new command line switch (/v) to validate tokens, so if any replacement tokens are missing, it will report an error message identifying the missing tokens, return a nonzero error code and not write out the file.

I left the current release as Beta 1 in case anyone finds any issues right away, but we've been using the new version on a project without any issues yet.  It should be a drop-in backward compatible replacement for the old version (except for the new dependency on .NET 2.0 instead of 1.1).

Introducing Birch Cove Software

Tue, 23 Sep 2008 20:19:59 GMT

A few days into a 3 week vacation with my family I received a call that I wasn't surprised to receive. The company where I had worked for 6 years was downsizing and my position, along with many others in our department, was eliminated. Since downsizing (or worse) was happening across the entire sector, I didn't take it personally. In fact, I took it as a sign that I should try something different. A friend recently said that "getting laid off is one of the best thing that ever happened to him", and I hope to look back and say the same some day.

So I am officially hanging out my shingle and becoming an independent contractor. I've worked as a full time employee for the entirety of my 18 years in the industry, so working for myself is going to be something completely new. So here begins a new chapter in my life: Birch Cove Software, LLC. Wish me luck, and let me know if you have any tips or resources for getting a consulting business off the ground.

Red Gate will take over development of Lutz Roeder's .NET Reflector

Wed, 20 Aug 2008 13:46:49 GMT

I just received a newsletter from Red Gate, and nestled in the headlines was this interesting tidbit. If you haven't heard of .NET Reflector, it's one of my favorites, and I encourage you to check this invaluable tool out. It's what you reach for when you have to know what's going on inside that assembly but don't have the source.

Here's the announcement on Red Gate's site:

James Moore who is the general manager of .NET Developer Tools at Red Gate states:

“I think we can provide a level of resources that will move the tool forward in a big way.  The first thing we are doing is continuing to offer the software to the community for free downloading.  The second thing is giving our product management and usability teams the task of going out into the community to get suggestions on how we can make this amazing tool even better."

I'm hopeful that Red Gate won't mess anything up. I've been using their ANTS profiler for years, and more recently discovered their wonderful SQL tools, and they are all excellent. For now they've promised to continue to give it away for free, but you know there will need to be some way to make money coming.

Subversion 1.5.1 Windows install is available

Tue, 19 Aug 2008 15:27:57 GMT

I've been working on a presentation for our next User Group meeting on Continuous Integration, and wanted to set up a local Subversion server.  Of course I wanted to use the latest and greatest versions of everything. So I've been checking back daily for the appearance of the installer for Subversion 1.5.1 for Windows.  Setup-Subversion-1.5.1.en-us.msi showed up on August 15, 2008.

You can find it on the Subversion download site  When you couple this with the latest TortoiseSVN you are cookin' with gas!

I found this CoDe Magazine article by Rick Strahl very helpful for setting things up initially. Setting Up and Running Subversion and Tortoise SVN with Visual Studio and .NET

Automatic Properties Work in .NET 2.0

Tue, 19 Aug 2008 15:17:00 GMT

This was sort of an accidental discovery, I'm not the first to stumble on it, but it doesn't seem to be widely known. A colleague of mine asked me about an interesting behavior he noticed after switching to Visual Studio 2008.  He was still targeting the .NET 2.0 framework, but noticed the automatic property feature worked.

Automatic properties are where you can just say

public string SomeProperty { get; set; }

The compiler provides the backing field and implements the get and set for you. It's a very nice shorthand syntax for a common pattern. We were all under the impression that it was a new C# 3.0 language feature and could only be used if you targeted version 3.5 of the .NET Framework. After searching around for why it was still working on a .NET 2.0 app, I found many who verified what we were seeing. Indeed it does work, because it's a compiler feature, and 2008 uses the latest compiler even if you are targeting 2.0. Cool.

IE 7 and Firefox browsing links in new tab by clicking your mouse scroll wheel

Fri, 23 May 2008 16:58:10 GMT

This is widely known, but I still run across people who use IE 7, and/or Firefox but don't use this little trick. On most mice, the scroll wheel is a button as well as a wheel. Click on links using the scroll wheel, and the browser will open that page in a new tab in the background without taking focus away from the current page.

I find this extremely handy when browsing results from a search engine. As you visually scan through the search results, click the links that look promising using the scroll wheel. The browser will set to work to load those pages in the background as you continue to scan.  After you've got a good batch of pages loaded in your tabs, you can skip through the tabs quickly.

We're starting a .NET user group in south-central Minnesota

Thu, 22 May 2008 14:23:25 GMT

We are starting a .NET user group in Mankato, which is in south-central Minnesota. Hopefully we can attract developers in the area that (like me) sometimes find it hard to make the 1-1/2 hour drive to the nearest .NET user group in Minneapolis. They're doing a great job up there in the Twin Cities, and I'll still try to make it to some of their meetings, but I just have a feeling there is a community of developers here that don't get much of a chance to hang out with geeks and talk shop.

So we have set up a web site, and set the date and time for our kickoff meeting.

Mankato .NET User Group Kickoff Meeting

When: Tuesday, June 10, 7:00 - 9:00

Where: Bethany College, 700 Luther Dr, Mankato, Minnesota We'll be meeting in Meyer Hall room 130. If you park in the Meyer Hall lot, room 130 is the first door on the right when entering from the lower level entrance. Map can be found here,


  • Introductions
  • Discuss regular meeting times & format
  • Discuss how to spread the word
  • Brainstorm topics and presenters
  • Presentation on new features in Visual Studio 2008 that make it a compelling upgrade

Web site:

If you are a developer in south-central Minnesota, consider joining us. If you know a developer in our area, we'd much appreciate if you pass this on to them.

Evoluent Vertical Mouse now available in wireless model

Thu, 15 May 2008 15:02:00 GMT

I've praised this mouse before, but just discovered that the wireless model of the Evoluent Vertical Mouse is now available. I have the wired version, and it is without a doubt the most comfortable mouse I've ever used. I throw it in my bag and drag it back and forth between the office and home. (I wonder how long before the cord gets a short?).

The only modification I made was to physically disable the large bottom button closest to the desk by inserting a small rolled up piece of paper behind it because I kept hitting it inadvertently while just moving the mouse.

The wireless one would be nice if anyone wants to buy it for me, my birthday is coming up.  Anybody have one yet?  How does it work?  How is the battery life?

Visual Studio Industry Partners (VSIP) program not needed to build a Domain Specific Languages (DSL)

Thu, 15 May 2008 14:44:22 GMT

After listening to a DotNetRocks podcast that interviewed Kevin McNeish on DSLs and Software Factories, I was curious to check out the DSL toolkit for internal use by our developers. After installing the Visual Studio 2008 SDK, I started seeing a “VSIP License Required” in the Visual Studio 2005 splash screen, and “A VSIP license is required to use this version of Microsoft Visual Studio” in the about box of Visual Studio 2005.  However, within Visual Studio 2008’s about box I see “Visual Studio SDK License”.  I was confused and wondered exactly when a VSIP license is required. I contacted someone at Microsoft and received clarification on this.

The Microsoft person verified that it is not necessary to join the VSIP program in order to build and use your own DSL implementation, internally or externally.  Apparently when Visual Studio 2005 was first released, extending Visual Studio was only allowed by licensed partners, but this restriction was later lifted, and licenses aren't necessary anymore. Unfortunately the messages in the splash screen and about box were not updated. Good to know.

MSBuild 3.5 just made my day

Thu, 27 Mar 2008 18:57:13 GMT

While doing some troubleshooting on a project I needed to manually copy some debug assemblies around after every build. But there were a lot of them, and whenever I need to do something repeatedly I try automate it with a script of some sort...because I'm lazy of course. There are a lot of choices today for a little quick and dirty script like this, Batch files, VBScript, Powershell, NAnt, but I thought I'd give MSBuild a try because I figured it would be the least amount of hassle, since moving files around is one of it's main duties during a build. The script was simple to write, but I hit a snag...the destination files were read only, and the copy errored out. MSBuild 2.0's copy task doesn't have an option to overwrite read only files. But MSBuild 3.5 does, so I learned a couple of tricks. 1. Run MSBuild.exe from C:\Windows\Microsoft.NET\Framework\v3.5 (instead of C:\Windows\Microsoft.NET\Framework\v2.0.50727). I have an external tool macro set up in my text editor (Textpad) to run the script currently being edited with a shortcut key, so this was simple to re-point. 2. Tell MSBuild you are using 3.5 features by adding ToolsVersion="3.5" to the Project element. .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }  [...]

Two things I learned tonight moving an ASP.NET site from IIS6 to IIS7

Wed, 12 Mar 2008 04:07:00 GMT

Tonight I moved moved an ASP.NET site from IIS6 to IIS7. Things seemed broken pretty badly at first, and I wondered if I was making a mistake to leave the comfort of IIS6. However, it turned out to be minor changes to the web.config. I'm sure they're already well known and well documented, but I figured I would scribble them down in case I ever need to do it again. 1. Remove the built-in Membership, Role and Profile providers If you are configuring your own Membership, Role or Profile providers with your own database connection string, make sure you remove the built-in ones.or you may get an exception about not being able to connect to "LocalSqlServer".  Which is the connection string used in machine.config for the stock providers. This did not happen under IIS6. So it turns out the bolded lines become very important under IIS7.                                     2. Move your Modules and Handlers to the section This one took me a while to figure out, but it shouldn't have. I had a custom module that was redirecting to secure pages when necessary, and it was not firing under IIS7. So I instrumented it up with log statements, and still nothing. Hmm. A quick search turned up Rick Strahl's post on this.               MODULES DON'T GO HERE ANYMORE              HANDLERS DON'T GO HERE ANYMORE                   FOR IIS7, MODULES GO HERE NOW               FOR IIS7 HANDLERS GO HERE NOW        [...]

Just for fun, controlling a Lego Mindstorms NXT robot with Windows Workflow Foundation

Thu, 06 Mar 2008 21:09:00 GMT

Recently I was asked to give a presentation on Windows Workflow Foundation to some developers. Unfortunately I had never worked with it. So last week while I was reading an article about workflow, it occurred to me that the designer seemed very similar to the NXT-G programming environment my kids use to program their Lego (R) Mindstorms (R) NXT robot. There's no better way to learn something than to actually try to do something real with it, so I decided to try to write my own custom activities to control a robot through Bluetooth connection.

Now this is a silly little app that doesn't do anything useful, but I thought it was too interesting to let the code just languish on my hard-drive only to be cleaned up someday when I'm low on space. It served it's purpose for me to learn Workflow Foundation better. I just posted the code to the MSDN Code Gallery here: There's plenty of room for improvement, but it was sure fun to write.

It includes a console driver program, as well as a Winforms based application that hosts the Workflow designer. The designer hosted version is based on the excellent MSDN hosting example by Vihang Dalal found at The bluetooth communication uses a wrapper called NXT# written by Bram Fokke at


 The robot I used to develop the application:


Speed up load time of AJAX Control Toolkit controls while debugging

Fri, 15 Feb 2008 20:05:00 GMT

This is probably already well known and well documented, but I still occasionally see people bemoaning the slow load time of some of the controls in the AJAX Control Toolkit. The slow loading problem is particularly noticable when you are debugging pages that have many calendar controls, at least that's where I first noticed it. In a post from Scott Guthrie, he explains why you should ..."never run production ASP.NET Applications with debug=true enabled". In this article, reason #4 states that "Scripts and images downloaded from the WebResources.axd handler are not cached". My theory is that this is the reason for the slow loading of the calendar control-laden pages when debugging your application. And sure enough when you set debug=false, the page loads faster thanks to the caching, but then you give up the ability to debug through your code. What should you do? Well, there's a middle-ground that worked nicely for me. You can set the ScriptManager on pages with lots of AJAX Control Toolkit controls to run in release mode like this:   Then you can leave Debug="true" in your web.config while you are developing without suffering the slow load time. Another thing you should consider doing is utilize the script combining feature introduced in build 10618 of the AJAX control toolkit, which is documented here. This can reduce the number of requests your page needs to make for all of the individual scripts. It's been a while since I set this up, but I think this was all that was necessary:  Add this file to your web site:  - - CombineScriptsHandler.ashx - - <%@ WebHandler Language="C#" Class="CombineScriptsHandler" %> using System;using System.Web;using AjaxControlToolkit; public class CombineScriptsHandler : IHttpHandler{    ///     /// ProcessRequest implementation outputs the combined script file    ///     ///     public void ProcessRequest(HttpContext context)    {        if (!ToolkitScriptManager.OutputCombinedScriptFile(context))        {            throw new InvalidOperationException("Combined script file output failed unexpectedly.");        }    }     ///     /// IsReusable implementation returns true since this class is stateless    ///     public bool IsReusable    {        get { return true; }    }} - - - Then use the ToolkitScriptManager instead of the straight ScriptManager in your pages, specifying the CombineScriptsHandlerUrl to point to the handler you just added, similar to this (note: the ScriptMode="Release" trick works here too). - - MyPage.aspx - - <%@ Page ..%> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> :: - - -[...]