Jun 26 2007

GhostDoc 2.1.0 Released

Category: ApplicationsRory Primrose @ 05:17

GhostDoc 2.1.0 has been released.

Tags:

Jun 20 2007

Sorting Windows Workflow rules

Category: .Net | ApplicationsRory Primrose @ 16:17

I've been having some issues with WF rules files over the last few weeks. I am using code generation to build some services that use workflow's in the business layer. The problems start when I run a code generation after editing the workflow rules and want to compare the difference. The result tends to be something like this for what is actually the same content:

CompareBefore

This is even a tame example. I have had full color difference indicators before.

The reason for this is that the WF designer does not reliably write the xml for the rules in the same way. From just a little bit of testing, it places new rules at the bottom of the ruleset, and places the last modified ruleset at the bottom of the file. I wrote a quick addin that searches for editable rule files in the solution and sorts the contents. It sorts the rulesets alphabetically by name, and then the rules according to descending priority. It will maintain the existing defined order of rules for those with the same priority.

I'm almost ashamed to post this addin because it is such a hack in its implementation. I had a problem where XPath queries were not returning results so the code has a couple of very unfortunate workarounds. That being said, the compare tool results now look like this:

CompareAfter

Download: WorkflowRulesSorter.zip (10.60 kb)

Tags: ,

Jun 19 2007

Using WinMerge with TFS

Category: .Net | ApplicationsRory Primrose @ 16:49

Someone at work was kind enough to figure out the correct command line switches to use in order to replace the standard TFS compare/merge tool with WinMerge. I originally blamed Pants for the info, but he then accused Eddie. Here are the goods:

In Visual Studio do the following:

  • Click on Tools menu
  • Click on Options menu item
  • Expand Source Control tree item
  • Select Visual Studio Team Foundation Server tree item
  • Click on Configure User Tools... button

Comparing

To use WinMerge as the Compare/Diff tool:

  • Click the Add... button
  • For Extension, type *
  • For Operation, select Compare
  • For Command, browse for C:\Program Files\WinMerge\WinMerge.exe
  • For Arguments, type /x /e /ub /wl /dl %6 /dr %7 %1 %2
  • Click OK to accept

Merging

To use WinMerge as the Merge tool:

  • Click the Add... button
  • For Extension, type *
  • For Operation, select Merge
  • For Command, browse for C:\Program Files\WinMerge\WinMerge.exe
  • For Arguments, type /x /e /ub /wl /dl %6 /dr %7 %1 %2 %4
  • Click OK to accept

Note: You need to click on the Save button on the tool bar within WinMerge merge to commit a merge before exiting the screen

Merge Error Workaround

If you encounter an error that says "The manual merge for <filename> has been canceled", the fix is to use a batch file to redirect the call to WinMerge to ensure a 0 return code.

This problem and workaround was originally found here by a colleague. He tested WinMerge and found that it does correctly return 0. Regardless of this, this batch workaround seems to work well. I have modified the original version to include my switches.

Create a batch file with the following content:

@rem winmergeFromTFS.bat
@rem 2007-08-01
@rem File created by Paul Oliver to get Winmerge to play nicely with TFS
@rem
@rem To use, tell TFS to use this command as the merge command
@rem And then set this as your arguments:
@rem  %6 %7 %1 %2 %4
"C:\Program Files\WinMerge\WinMerge.exe" /x /e /ub /wl /dl %1 /dr %2 %3 %4 %5
exit 0

The merge instructions above will then be changed to:

  • Click the Add... button
  • For Extension, type *
  • For Operation, select Merge
  • For Command, browse for C:\Program Files\WinMerge\winmergeFromTFS.bat
  • For Arguments, type %6 %7 %1 %2 %4
  • Click OK to accept

Modified C# Filter

WinMerge uses filter files to filter the entries found when comparing folders. The latest version of WinMerge bundles a C# filter file. I have updated it to include additional entries. Copy the content below into C:\Program Files\WinMerge\Filters\CSharp_loose.flt.

## This is a directory/file filter for WinMerge
## This filter suppresses various binaries found in Visual C# source trees
name: Visual C# loose
desc: Suppresses various binaries found in Visual C# source trees

## This is an inclusive (loose) filter
## (it lets through everything not specified)def: include
## Filters for filenames begin with f:
## Filters for directories begin with d:
## (Inline comments begin with " ##" and extend to the end of the line)
f: \.aps$ ## VC Binary version of resource file, for quick loading
f: \.bsc$ ## VC Browser database
f: \.dll$ ## Windows DLL
f: \.exe$ ## Windows executable
f: \.obj$ ## VC object module file
f: \.pdb$ ## VC program database file (debugging symbolic information)
f: \.res$ ## VC compiled resources file (output of RC [resource compiler])
f: \.suo$ ## VC options file (binary)
f: \.cache$ ## ??
f: \.resource$ ## Compiled resource file.
f: \.xfrm ## ??
f: \.bak$ ## backup
f: \.vssscc$ ## Source control metadata
f: \.vspscc$ ## Project source control metadata
f: \.user$ ## User settings
f: \.ReSharper$ ## ReSharper data

d: \\bin$ ## Build directory
d: \\obj$ ## Object directory
d: \\cvs$ ## CVS control directory
d: \\.svn$ ## Subversion control directory

Updated:

After checking out James Manning's blog post about compare/merge tools (thanks Grant), I have updated the command line arguments. For the most part, it is a merge of the switches in this original post and James' switches. The /x /e switches give the tool the same behaviour as the TFS tool for using the ESC key and identifying identical files. James' has include the use of the /ub /dl /dr switches to avoid MRU persistence and adds version labels to the left and right sides. I have also added /wl so that the left (server) side file is read-only.

If you want to know more about the WinMerge switches, you can get the online help from here.

Updated:

As suggested by Scott Munro, I have removed %3 from the merge switches, but I have still retained the /wl switch.

Updated:

Added TFS error workaround and my version of the C# filter.

Updated:

Added a reg file that contains the original settings outlined above (does not include workaround).

WinMerge for TFS.reg (1.12 kb)

Updated:

Added reg files for VS2010 x86 and x64

WinMerge_for_TFS_VS2010_x86.reg (1.12 kb)

WinMerge_for_TFS_VS2010_x64.reg (1.14 kb)

Tags: , , , , , ,

Jun 19 2007

Dynamic searching in TSQL

Category: IT RelatedRory Primrose @ 15:05

As I have been writing some SQL Server based software recently, I want to expose a standard way of providing searching capabilities for tables and views. The initial implementation started with a set of WHERE conditions like the following:

WHERE (FieldA = @FieldAValue OR @FieldAValue IS NULL)
        (FieldB = @FieldBValue OR @FieldBValue IS NULL)

I now want to extend this functionality to include sorting and perhaps paging as well. I came across this article by Erland Sommarskog (SQL Server MVP) which address a ton of sorting variations.

Tags:

Jun 19 2007

VS2005 performance tips

Category: IT Related | .NetRory Primrose @ 10:50

This post has some good tips for increasing the performance of the VS2005 IDE.

Tags:

Jun 19 2007

Want to develop on Vista?

Category: .NetRory Primrose @ 06:55

So I now have my new laptop which came bundled with Vista Home Premium. After I had it set up, I then started on some development.

First time I hit F5, I get an error saying that I can't debug IIS based projects because of an authentication problem. I'm thinking that I just don't have the Windows features installed as required to support this. I would be right, but what I soon learn is that there is a restriction that Vista Home Premium doesn't support Windows authentication in IIS.

Are you kidding me! How many developers are going to end up with Home Premium expecting to do IIS development using Windows auth. This is nuts. What really rubs salt into the wound is that I could have got Vista Business bundled with the laptop for an extra $9, if only I had read this fine post. Unfortunately Microsoft's feature comparison chart of the Vista editions didn't quite go to this level of detail.

Do I blame Microsoft? No, it is my fault for not doing enough detailed research, but such fine detail is not easy to identify when choosing the correct Vista edition. To cover your bases, I think people are just going to have to get Vista Ultimate to avoid the risk of not having some little specific bit of functionality.

Tags:

Jun 7 2007

Vista VS2005 installation order

Category: .NetRory Primrose @ 03:51

I'm just about to get a new laptop which will be running Vista. This got me thinking about the installation order for VS2005. There are so many bits and pieces to install, but what is the correct order. This is what I'm thinking.

  1. Vista
  2. IIS
  3. Sql Server 2005
  4. Visual Studio 2005 Team System
  5. Visual Studio 2005 MSDN documentation
  6. Visual Studio for Database Professionals
  7. Microsoft Visual Studio 2005 - Update to Support Web Application Projects (this is included in VS SP1)
  8. Sql Server 2005 SP2
  9. Visual Studio SP1
  10. Database Professionals SP1 (SR1)
  11. Visual Studio 2005 Extensions for WF
  12. Visual Studio 2005 Extensions for WCF, WPF
  13. .Net 3.0 SDK
  14. Visual Studio 2005 Update for Vista

Any pointers?

Gert Drapers from the Visual Studio Database Professionals team replied to an email of mine to indicate this order:

  1. SQL Server 2005
  2. Visual Studio 2005
  3. Visual Studio Team Edition for Database Professionals
  4. Visual Studio 2005 SP1
  5. Visual Studio 2005 SP1 Vista patch
  6. SQL Server 2005 SP2

Tags: , , , , ,