Blog Home 
public interface IGrocholski - Tools

RSS 2.0 Atom 1.0 CDF  
 
Sign In
 
 Friday, February 23, 2007

Service Pack 2 for all editions of SQL Server 2005 was released on Monday. Unfortunately for us .NET developers, the Visual Studio Bootstrapper we were hoping would ship with the release did not. Mike on the SQL Server Express team is working on it and hopes to release it by mid March. You can read more on his work here.

I'm not a patient guy so I decided to create my own. (After all, shouldn't I, since I've been raving about the bootstrapper as of late?)

Here's what it does:
1. Check if SQL Express is installed
2. If SQL Express is not installed, it install SQL Express SP2
3. If SQL Express RTM is installed, it upgrades RTM to SP2
4. If SQL Express SP1 is installed, it upgrades SP1 to SP2
5. If SP2 or later is installed, it does nothing

These checks are performed by my SqlExpressSP2 application. All these does is read the CurrentVersion value of the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion registry key.

I tested the boostrapper on installs on Windows XP SP2 and Windows Vista business. The installs worked without problem. I created an installer for the bootstrapper, but it's file size was over 55Mb, a little to big to dump on the blog. So, if you want a the bootstrapper you'll need to create it yourself via the following steps:

1. Create the following directory: [drive]:\[program files]\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\SqlExpressSP2.

2. Copy these files to the folder created in step 1 above:
     2.1. product.xml (.55 KB)

     2.2. SqlExpressSP2Chk.exe (16 KB)

3. Download SQL Server 2005 Express Edition Service Pack 2 from the download page

4. Create the following directory Create the following directory: [drive]:\[program files]\Microsoft Visual Studio 8

\SDK\v2.0\BootStrapper\Packages\SqlExpressSP2\en.

5. Copy the following files to the the direction created in step 4 above:
     5.1. SQLEXPR32.EXE (downloaded in step 3 above)

     5.2. package.xml (9.61 KB)

     5.3. eula.txt (8.03 KB)

To use the bootstrapper follow the steps:

1. Fire up Visual Studio 2005.

2. Create a Setup and Deployment project.

3. Go to the Projects menu and click Properties.

4. Click the Prerequisities button.

5. You should see an entry in the prerequisites list for SQL Server Express Edition SP2.

6. Select the prerequisite(s) you want and select the "Download prerequisites from the same locations as my application" option.

7. Click OK.

8. Click Apply and OK.

9. Build you Setup and Deployment project.

10. SQL Server Express 2005 SP2 will now be deployed with your application.

Hope this helps.

ag

2/23/2007 7:19:01 AM (Central Standard Time, UTC-06:00)  #    Comments [3]   .NET Development | Tools  |  Trackback
 Tuesday, February 13, 2007

In order to verify the integrity of a package file the Visual Studio Bootstrapper keeps track of either a Hash or PublicKey value.  These are indicated by attributes in the Bootstrapper package manifest. However, what if you don't know the Hash or PublicKey value? I ran into this situation recently when creating a Bootstrapper for a third part application I needed to include with my application. To resolve the issue I created a couple of utilities that will determine the Hash and PublicKey of a given file (if signed). I then put these values into the bootstrapper's package.xml file and everything worked as expected.

Here's the file containing the utilities: blogs.rba.agrocholski.20070213.001.file.001.zip (75.71 KB)

ag

2/13/2007 12:17:15 PM (Central Standard Time, UTC-06:00)  #    Comments [0]   .NET Development | Tools  |  Trackback
 Thursday, February 08, 2007

One of my favorite features in Visual Studio 2005 is the new Bootstrapper functionality. You can get an overview of it here. In short, it replaces the merge modules of old. It allows you to make your application a prerequisite that you can then bundle with other applications.

When you dig into it, you'll see that it's essentially based on a couple of xml configuration files (package.xml and product xml). These configuration files allow you to specify which files to include in te bootstrapper, any prerequisites required by your application, and and any install checks (i.e. registry key evaluation) that needs to be performed during install.

Managing these config files isn't the easy of things as their schemas aren't well documented. However, David Guyer has created a tool that can help you modify and created these xml files. You can get the tool here. One word about the tool, I've usually had to tweak the files generated by this tool to get everything to work properly.

So, you may be asking yourself "Why would I really want to use this?" Well, I can name two instances off hand were it's come in handy for me.

1. I needed to install a named instance of Sql Server Express with network connectivity enabled. To do this, I tweaked the package.xml and product.xml files for the SQL Server 2005 Express Edition bootstrapper that comes with Visual Studio.

2. I needed to install Sql Server Express SP1. This required the creation of a custom bootstrapper from scratch. This wasn't to hard but I also had to create an application that would determine if Sql Server Express was installed, and if it was install which version. If Sql Server Express was not installed or Sql Server Express RTM was installed SP1 would then be installed. If not, the installation is bypassed.

There are a number of other uses for this unheralded feature. Take a look at it when you have the time.

ag

2/8/2007 9:53:44 PM (Central Standard Time, UTC-06:00)  #    Comments [0]   .NET Development | Tools  |  Trackback
 Thursday, January 25, 2007

We agree, I hope, that test driven development is one of the founding pillars of solid software construction. However, have you ever been on a project that contained so many dependencies that you found yourself writing more configuration and tear down code than actual unit tests?

For example, a typical scenario these days has a database, a web app, some web service, and a windows app. The web app updates the database and the client app calls the web service to pull down data. However, how do you adequately test the client code that calls the web service. Do you write a bunch configuration code to have the web app insert data? But what if the data already exists? You'll need to write more configuration code to clean out the database. Ok, maybe you could write a couple of lines to drop the database and attach an .mdf file. Or...

Wait a minute, is this really unit testing? No, it's integration testing. All you want to do is test the client code that calls the web service. You don't care what the web service does. Enter mock objects. By using mock objects you can eliminate the dependencies by mocking them. Essentially what you do is interecept calls to the real objects and substitute mock objects in their place. This gives you the power to control what gets returned from your calls and allows  you to actually test your objects without having to worry about dependencies.

I've used a number of mock objects over the past year or so, including EasyMock.NET, Rhino Mocks , TypeMock, and  NMock. Of these NMock has been my favorite. Unlike the mock object frameworks in order to mock an object with NMock you must define an interface that the object implements. A little more work, but this a good practice anyway. Best of all NMock is free.

So, if you want to make implementing test driven development easier try mocking something (just not me).

ag

1/25/2007 4:08:36 PM (Central Standard Time, UTC-06:00)  #    Comments [0]   .NET Development | Tools  |  Trackback
 Friday, January 19, 2007

This is an homage to James Avery, the man always looking for new tools.

We all have those little tools that we use when writing code to help our productivity. I was looking around on one of my external hard drives last night and realized that I have a ton of tool installers sitting there. As I looked through them I realized I'm currently only using a handful. So rather than going into detail on all the various tools I have lying around, I thought I'd give the lowdown on the ones I'm currently using. So here you go:


SlickEdit Gadgets for Microsoft Visual Studio 2005
Currently this is my favorite free tool. There are a bunch of cool features in this, but I have three that are my favorite:
1. Line ruler - Places a "ruler" highlight across your current line (where the cursor is) and has tick marks to indicate the editor's indentation levels.
2. Indentation guide - Draws a vertical bar in the editor indicating the indentation level of the current line.
3. Command Spy monitors command execution and allows you to see exactly what commands you've run, how many times you've run them and what key bindings are used to invoke those commands. The main purpose of this tool is to allow you to learn what commands are bound to which keystrokes, so that you can work faster within the IDE.
4. The SLOC Report tool provides an easy way to count the lines of code. The line count is divided into three categories: code, comments, and whitespace. Once the lines of code have been counted, the results are drawn as a pie graph.


XML Notepad 2007
This is simply a great tool for working with xml documents. It's simple to use, just open up your document with XML Notepad 2007 and start edition. If you used the original version then you're in for a treat. Here are the features that have been added to the version:
1. Incremental search (CTRL+I) in both tree and text views, so that as you type it navigates to the most matched node.
2. Cut/copy/paste with full namespace support in a simple interoperable XML format.
3. Drag/drop support for easy manipulation of the tree, even across different instances of XML Notepad and from the file system.
4. Infinite undo/redo for all edit operations.
5. In-place, pop-up, multi-line editing of large text node values and IntelliSense based on expected elements and attributes.
6. Configurable fonts and colors via the options dialog.
7. Full find/replace dialog with support for regex and XPath expressions.
8. Good performance on large XML documents (loading a 3 MB document in about one second).
9. Instant XML schema validation while you edit with errors and warnings shown in the task list window.
10. Support for custom editors for date, dateTime, time, and color datatypes.
11. HTML viewer for displaying XSLT transformation results.
12. Built-in XML Diff tool.

XPathMania
Hate writing XPath? For me hate is an understandment. This is a nice little add-in that will show up as a tool window in Visual Studio. Open up an xml document you want write xpath against in the editor window then start writing your query in the XPathMania window. I found this to be a huge time saver.

Bootsrapper Manifest Generator
If you don't know or haven't created custom bootstrappers for Visual Studio 2005 then you don't know what you're missing. You can get a taste of it here. If you have created bootstrappers you know the pain that can come with trying to generate the necessary manifests for the boostrapper to work correctly. This is a nice GUI that will walk you through the steps of creating a manifest for your bootstrapper. A word of caution, I've had mixed results with the manifests that get generated. I find that I usually need to make a manual tweak or two (using XML Notepad 2007 of course) and then I'm up and running. One of my upcoming posts will dive into the boostrapper functionality in depth, so stay tuned.

Sandcastle and Sandcastle Help File Builder
When .NET 2.0 came out we all shed a tear when NDoc failed to keep up. I know some of use have been using Doxygen to generated documentation form code, but it wasn't really built to work with C#. Enter Sandcastle. This is Microsoft's command line tool you can use to turn your code comments into nice help file documentation. It's great MSFT has stepped up to fill the void, but the command line is a pain to use. There's a sample here, but I have yet to get it to work successfully. Feeling these frustrations a couple of guys created a GUI and called it the Sandcastle Help File Builder. There are loads of nice features with the GUI, but here's the two I like best:
1. The GUI interface is almost identical to the NDoc interface so anyone familiar with NDoc should be quite comfortable using it.
2. The settings are saved in a project file and the help file can be built from within the GUI or you can add a step to your MSBuild process that runs the command line tool to build it for you using the same project file.

If you haven't seen this yet, I recommend checking it out.

CopySourceAsHtml
First, ignore the horrible formatting of the site where this tool can be found. I think the developer made it look so bad just to show what the tool can do. I haven't used it a whole lot but it's pretty cool. If you right-click on some selected code in Visual Studio you'll get a Copy as Html option.

Well I didn't mean to ramble this long and I didn't event get to the cool mock object tools I've been playing around with. I guess that will have to wait for another day.


ag

1/19/2007 8:49:27 AM (Central Standard Time, UTC-06:00)  #    Comments [0]   .NET Development | Tools  |  Trackback
Copyright © 2008 RBA Consulting.