Fix: Microsoft File Transfer Manager Keeps Downloading Old Cancelled Entries

Microsoft File Transfer Manager screen shotThe Problem:  A few months back I had some issues downloading files from Microsoft Connect and MSDN Subscriber Downloads.  Ever since then, the Microsoft File Transfer Manager (FTM) has been acting crazy.  It retains entries to previous successful and cancelled downloads and attempts to re-download them (unsuccessfully) every time I try and download something new.  Cancelling these entries repeatedly does not make any difference.  They keep reappearing.  THIS IS QUITE ANNOYING! 

The Fix:  Today I fixed the issue.  After firing up Procmon I quickly determined that File Transfer Manager was reading files from the following folder:

C:\Users\MickeyMouse\AppData\Roaming\Microsoft\File Transfer Manager\RequestQueue

The RequestQueue folder contained a bunch of files with the extension .dlm.  After deleting all of these dlm files Microsoft FTM started working again as normal.  I did not bother looking in these files, I just figured they contained the fubar requests and thus deserved to be destroyed without impunity.

PS My username is not MickeyMouse.

  Posted: 12:16:11 Thu 19 Feb 2009  Tags: Microsoft File Transfer Manager | Micro-Tedium | Tips
   Permalink Comments [2]

Easy Commerce Server Pipeline Component Debugging with IIS7s appcmd.exe

If you have worked on a large Commerce Server implementation, you have likely built a custom pipeline component or two.  This makes you part of a very special band of brothers (requires Facebook login).  It also means that you have probably seen your fair share of the build error "Unable to copy file ... The process cannot access the file XYZ" (pictured below in all it's namespace censored glory)...

Picture of build error, unable to copy file ... the process cannot access the file XYZ.

This error usually occurs when you build pipeline component project, having just run a pipeline that contains the same physical component (or another component in the same assembly).  The reason it occurs is that the process hosting your website (in my case w3wp.exe) has an open file handle to the assembly containing your pipeline component.  Hence you can't copy over it :(

In the past I have resolved this using one of the following methods:

However, all of these involve what I call micro-tedium.  Micro-tedious tasks are those computing tasks that are so small that they appear insignificant, but in reality suck the life out of you (like the Large Hadron Collider is also probably doing right now).

Anyway, I digress.

My Slightly Funky but Practical Solution to "The Process Cannot Access the File" Tedium

IIS7 ships with a new tool called Appcmd.exe.  It is a command line tool that lets you do useful stuff like create and configure sites, view information about worker processes and start and stop application pools!

So, for pain free pipeline component development, use appcmd.exe in the pre and post-build events of your pipeline component project, to stop and start the application pool that hosts your Commerce Server site.  My build event commands look like this (you will need to replace DefaultAppPool with the name of the Application Pool your Commerce Server site is running in):

Picture of pre-build command line: %systemroot%\system32\inetsrv\appcmd.exe stop apppool DefaultAppPool

Picture of post build command line: %systemroot%\system32\inetsrv\appcmd.exe stop apppool DefaultAppPool

Configuring your build event commands like this results in the following occurring in order when you build your pipeline component project:

  • Before the build, the application pool is stopped.
  • Your project builds.
  • After the build the application pool is started again.

It works for me.  Does it work for you?  Any elegant(er) solutions out there?

Important Note about Exit 0The exit 0 command is included so that the return code is always success, even if appcmd has a non-success return code.  I do this because Appcmd will fail to stop the application pool, if the application pool is not already running.  This would then cause your build to fail.  The exit 0 command stops that happening.  If you have other commands in your build event, exit 0 could mask their failure.

Stuck on IIS 6?  If you are stuck on IIS 6 you may want to hack up something similar using one of the IIS 6 Command Line Tools (I think it is possible!).

Appendix:  Paste-able Version of the Appcmd Commands Used
%systemroot%\system32\inetsrv\appcmd.exe stop apppool DefaultAppPool
exit 0

%systemroot%\system32\inetsrv\appcmd.exe start apppool DefaultAppPool
exit 0

  Posted: 07:16:11 Mon 15 Sep 2008  Tags: Commerce Server 2007 | Commerce Server Mojave | Micro-Tedium | IIS 7 | Pipeline Components | Visual Studio
   Permalink Comments [0]