Thoughts from the office by Ed Ball
Tuesday, February 14, 2006

For the most part, it is a pleasure working with Visual Web Developer 2005 Express. Of course, the fact that it was absolutely free is probably still having an unfair influence on my opinion. At the very least, it is hard to argue with a free IntelliSense-enabled editor.

However, one aspect of the product has been driving me crazy. When you add a reference to one or more assemblies, it adds the .dll and .pdb files to the Bin folder of the project, but it also adds a .dll.refresh file. This file causes the build process to see if the .dll file has been updated at its original location and copies it if it has. This is a great feature, except that it is unbelievably slow. I have a project with 8 assemblies added to the project in this way, and a simple Build takes minutes, every time. I'm not sure why this process is more complicated than checking to see if the file has changed and copying it if it has, but I'm sure I'm missing something.

At any rate, I'm not willing to wait that long every time I need to build the solution, so I use a simple workaround. I've deleted the .dll.refresh files from the project and I use a batch file to update the assemblies instead. Without the .dll.refresh files, the project builds quickly. The batch file not only copies the assemblies, it first builds the Visual C# Express projects for those assemblies with msbuild to make sure that they are up-to-date. Thus the batch file solution is not only much faster than building the solution with .dll.refresh files, it is also more useful, as I don't have to open those projects, make sure that the proper configuration is selected, and build them.

Here's the basic design of the batch file:

@echo off
pushd (C# project directory)
msbuild /property:Configuration=Debug
xcopy /d /y bin\Debug\* (Web project directory)\Bin
popd
pushd (another C# project directory)
msbuild /property:Configuration=Debug
xcopy /d /y bin\Debug\* (Web project directory)\Bin
popd

I have a similar batch file that builds and deploys the Release binaries, which is another advantage over Visual Web Developer, since it doesn't directly support Debug and Release configurations.

I'm sure that Visual Studio 2005 solves all of these problems and then some, but I'm willing to jump through a few hoops to use the free Express editions...

Update: Used xcopy /d so that it doesn't overwrite the destination file if it hasn't changed.

2/14/2006 9:16:05 AM (Pacific Standard Time, UTC-08:00) | Comments [2] | Tools#
Search
Archive
Links
Categories
Administration
Blogroll