net, build, vs comments edit

I’m working on a Visual Studio .NET add-in project where we need to be able to build the project both through the Visual Studio IDE and through NAnt.

So I’ve got NAnt 0.84, which builds all the other projects (using the <solution> task) I’ve got just fine, but gives me this error: System.NullReferenceException: Object reference not set to an instance of an object. at NAnt.VSNet.Reference..ctor(Solution solution, ProjectSettings ps, XmlElement elemReference, SolutionTask solutionTask, String outputDir)...

And so on, tracing down the whole call stack. What’s the deal?

As you (probably) know, references in a .csproj file look like this:

<VisualStudioProject>  <CSHARP>   <Build>    <References>     <Reference      Name = "EnvDTE"      AssemblyName = "EnvDTE"      HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\EnvDTE.dll"     />    </References>   </Build>  </CSHARP> </VisualStudioProject>

Of course, the “HintPath” attribute is optional.

Apparently it’s not an option for NAnt. The add-in wizard doesn’t put HintPath in for your references, and regardless of what you do, NAnt won’t build without it. (Yes, I added <assemblyfolders> attributes to the <solution> task - you need those, too, but it doesn’t fix it.) So manually edit your .csproj, add the HintPath, and you’re in.

General Ramblings comments edit

Hockey season, at least as far as the Winter Hawks are concerned, has begun. This means 36 home games between this past weekend and next March, which is quite a lot if you think about it.

We went to two hockey games this weekend - one Saturday night (which we lost) and one Sunday night (which we won) - and we’ve got another coming up on Wednesday. I love hockey season - it’s a social event, similar to folks meeting up at the local pub or whatever - but it sure does take a lot out of me.

At last night’s game, during the first intermission, two altogether too avid hockey fans got married at center ice, the team mascot acting as “best man” (or “best bird,” in this case). I’m not sure I’m into that. I think it’s cool to be a fan and all, but married at center ice at the second game in the season for a junior league team? That’s a little much. (The “best bird” dropped the ring in the middle of the ceremony and wasn’t able to pick it up off the ice with the mascot gloves on. They had to stop the ceremony and pick it up for him. Too funny.)

An idea came to me while watching the Zamboni ice resurfacer run its course around the rink at the game: They need to make a riding lawnmower that looks/works like a Zamboni. A Zamboni lawn resurfacer, if you will. The collection tank could catch the grass… it’d be brilliant. Maybe I’ll have to submit that idea to them.

Side note: Last month my dad was driving home from work and the motorhome behind him was driving a little erratically (according to witnesses). It then attempted to pass (or something) in a no-pass zone. For those who think they can pass in the no-pass zone, here’s the accident that happened right behind my dad:

Don't pass in the no-pass

Pieces of motorhome landed on the back of Dad’s truck. Apparently they had to use the Jaws of Life to get the motorhome driver out. Crazy stuff.

net, vs comments edit

I sent this to Scott Hanselman like three months ago and didn’t mention it here, but I ran into this again today (with the same set of users that originally had the problem

  • surprise, surprise) so I figured it was worthy of repetition.

If you have the Microsoft Loopback Adapter running on a machine where you try to execute a web setup project generated from Visual Studio .NET (an MSI file), you’ll get the following error:

The specified path ‘http://MACHINENAME/http://MACHINENAME/InstallFolder’ is unavailable. The Internet Information Server might not be running or the path exists and is redirected to another machine. Please check the status of this virtual directory in the Internet Services Manager.

The problem, as you can see from the message above, is the Loopback Adapter doing its job - looping back on itself. That messes up the installation path, though, and the MSI pukes.

To fix the issue, disable the Loopback Adapter, run the installer, then when the install is finished you can re-enable the Loopback Adapter.

downloads, javascript comments edit

I love the Amazon Associate program. I’m a member and I even buy stuff from myself to get a kickback. It’s also a good place to send people when you want to show them books, music, movies, etc., that you’re talking about. Sort of like a database of “stuff.”

One of the beauties of the way Amazon set their stuff up is that everything is standardized - link formats, image naming, etc. Everything. Which means, of course, that people outside Amazon can interface with their stuff pretty easily. Good for them, good for us.

I integrated Associate links into my blogging program (pMachine) so I only have to enter the ASIN for an item and it builds the link for me. I wanted to take that one step further, though, so I present to you: Amazon Affiliate DHTML Image Tooltips!

The idea is this: Hover your cursor over any Amazon Associate link to a product and get a picture of the item right there in the tooltip. How sweet is that?

It doesn’t even require any change to your page structure, which is what I really dig. Just add a straight-up Amazon Associate link to your page like you usually do:

<a href="">A Cool Product</a>

Then add a reference to the script at the head of the page:

<script type="text/javascript" src="dhtmltooltip.js"></script>

The script will automatically rewrite all of the Amazon Associate links in the page (that are in the correct format, as noted above) on the fly for you with the correct events and everything.

(It will also do text tooltips - it’s a modification to the Dynamic Drive “Cool Tooltip” script.)

It all ends up looking like this: Screenshot of Amazon Associate DHTML

The download includes:

  • dhtmltooltip.js - The actual script that performs the DHTML and link rewrites. Information on usage is included in the header of the script.
  • test.html - A test page illustrating the script usage (both Amazon Associate and text tooltips).

Note: Since the original release of this DHTML tooltip script, Amazon has released their own “link-enhancer” script that performs a similar functionality but in a more robust fashion, adding product description information and so forth to the tooltip. This DHTML tooltip script has been updated to work in conjunction with that, not modifying links that the Amazon script has already modified. As such, previous users of this script can easily add the use of the Amazon script to their site without worrying about clashing tooltips appearing. Amazon modified links appear correctly; those not modified by Amazon or explicitly using this DHTML tooltip script will continue to function as usual.

I’ve tested it in IE 6.0 and Firefox 1.0, which I think covers most of the people who show up to my site. I’m sure it’ll work with most any up-level browser, though if someone finds it doesn’t work on a particular browser, tell me how to fix it and I will.

Like it? Want it? Here you go!

Download Amazon Associate DHTML Image Tooltips Script 2.1 (.zip file)

Version History: 2.1: Added support to allow co-existing with Amazon “link-enhancer” script. The DHTMLToolTip will not be added to links that have been “enhanced” by the Amazon script. 2.0: Converted to “object oriented” JavaScript to avoid name clashes. Fixed minor bug with positioning in newer browsers. Safely attaching to all events (thanks to Phil Haack for this). Updated so script is placed in HEAD of document. 1.0: First release.