Scott Hanselman

VS.NET 2005 Publishing SignTool Confusion

November 15, 2005 Comment on this post [0] Posted in Programming | Tools
Sponsored By

I really am made uncomfortable when I get messages like:

SignTool reported an error 'Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.'.

...and they are fixed by restarting Visual Studio. Additionally, I'm not sure what the LoadedExceptions property is or where I'm to find it.

This happened over lunch as I was publishing a ClickThrice application to hanselman.com. I'd had a solution with three projects that was building and publishing fine. I moved two of the libraries from Project references to direct assembly (lib) references and rebuilt. Everything rebuilt fine, ran fine, but publishing was broken. Visual Studio 2005 crash, Dr. Watson announced his concern, I killed all devenv.exes and started afresh. Works now. Woof.

That said, MSBUILD still kicks the llama's ass.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Performancing.com - Review of DasBlog

November 15, 2005 Comment on this post [7] Posted in ASP.NET | Reviews | DasBlog
Sponsored By

The blog performancing.com has a review of dasBlog as part of their review series on blogging software. The review is quite positive. Here is the summary:

DasBlog is a suprisingly fully-featured system. For simplicity and features it beats bBlog, it's closest rival in terms of target market, and has some features that Movable Type even lacks. Bigger picture though I can't see a general user choosing this over MT or Wordpress.

It is definately (sic) a good choice for someone looking for a single .NET based blog though. Knowing that CommunityServer is not aimed at single bloggers, in the single .NET blog scenario I would say DasBlog is the top choice.

Thanks to Vasanth for the link!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

BeyondTV4 Upgrade Review - Media Center Alternative?

November 13, 2005 Comment on this post [4] Posted in Reviews | Coding4Fun | Web Services | Gaming
Sponsored By

I paid for Beyond TV 3.5 and a Hauppauge PVR-250 on my main desktop machine a year before I made a Media Center PC. Interestingly, the Media Center PC has turned into a heavy MAME arcade machine and is rarely used, if ever, for TV. Perhaps that will change with the XBox 360's new Media Center Extender (as the original XBox Media Extender sucked egregiously) but we will see. Until then, I keep ending up watching TV on my main PC, using Beyond TV. So, it made sense when Beyond TV 4.0 was release a few days ago that I give it a trial. Here's a few impressions

Upgrading

The upgrade from Beyond TV 3.5 was a complete fiasco. Not failure, fiasco, there's a difference. During the setup I was informed that a number of .ax files (.ax files are actually just COM DLLs that have a different extension. They are codecs for the decoding things like video and audio.) were in use can couldn't be overwritten. My options were "Retry" (Um, can't!), "Ignore" (Um, dangerous!), and "Cancel" (Um, and do what?), so I, like a putz, selected ignore. In retrospect I should have selected Cancel and figured out who was locking the files. But, I charged on.

Interestingly, to me at least, Beyond TV 4 decided that it was cool to put itself in the existing Beyond TV 3 folder called c:\program files\snapstream media\beyondtv3. Since it's not version 3, that seemed ingenuous, but perhaps I'm being too hard. Either way, it failed to start up and was unable to show video. The install was hosed at that point.

Turned out that since I'd just tried a Web Cam conversion using the new MSN Messenger 7.5 and a little QCAM USB Gooseneck camera I picked up, that MSN Messenger had loaded every registered codec on the system into msnmsgr.exe's memory space. So, I blew away Messenger and figured I'd just run the installer again and select "repair." Which would have totally worked had there been a "repair" option.

Long story short, totally uninstall and reinstall of 4.0. Afterwards though, it started fine.

Footprint

Windows Task ManagerColor me dorky but I always like to check out the system footprint of applications I run. Even more so since I started running without a paging (virtual memory) file.

Points to Snapstream for prefacing all the new processes with BTV*, but still, EIGHT processes? Um, ouch. Of course, who am I to complain considering that Microsoft released a whole new OS. (Yes, I know that's not totally true, but it's true from a marketecture point of view, so phooey on you.) There's also an extensive, but confusing series of COM interfaces that Clemens has seen fit to mess with, although there's also a Web Services API. We'll see what happens with that.

Chunks of BeyondTV are written in .NET 1.1 and there's no fewer than 28 .exe.config files that remind .NET that BeyondTV prefers .NET 1.1. There's over 130 DLLS and 30 EXEs that make the whole thing happen. It's a pretty complex goings on, but fortunately it's all in one folder and its footprint hasn't affect anything other than my curiosity. I've found it to be fantastically stable if a bit of a memory hog, but certainly less in total than any single Microsoft Office program.

Weird Things

  • Beyond TV 4 has a new "Lock Aspect Ratio" option, which is nice, but the only options are 4:3 or 16:9. That's not particularly useful when my monitor (and most desktop Widescreen LCDs) are 16:10. Valve Software's Steam is the BEST when it comes to awareness of the various aspect ratios available. GuildWars also handles odd ratios with grace.
  • Documentation is still a little sloppy. There's references to Beyond TV's 3.5 directory, old EXEs and what-not mixed in amongst the new stuff within the CHM (Help) files. Just shows a lack of attention to detail.
  • The "Web Admin" option seems to have disappeared from the right-click menu of the Beyond TV Tray Icon. The Web Server (Cassini-like) still runs on http://localhost:8129 so you can still get to it, but it seems odd to have been removed not only from the Tray but the Start Menu also. Also, it appears to be handled by BTVNetworkService.exe now, not BTVWebServer, but they both ship with 4.0.
    • UPDATE: The "Open Web Admin" feature exists but it's off by default now. Oddly enough I had to enable it FROM the Web Interface, so not exactly sure how Mort is expected to turn that chicken-and-egg feature on.
  • Beyond TV 4.0 has a great 3D accelerated video mode that does transparent overlays for all the interface elements. However, on my dual monitor machine it only works well on my primary monitor. When I try to view the TV on the secondary monitor the framerate drops precipitously. However, when I switch it to software-only rendering everything's great on the second monitor. It's more valuable for me to be able to use the second monitor as a TV, so I turned software rendering on against their recommendation and it works fine. I don't notice much of a different but the CPU does jump from 10% to 30%.
    • Literally as I was writing this sentence, while running Beyond TV 4 in Hardware Accelerated DX9 mode, I moved it from the secondary to the primary monitor and POOF. BIOS. Like, POOF. No warning, just BOOM. So, I'm running Software Accelerated now. Also interestingly that never happened while running Beyond TV 3.5, but in their defense I just upgraded my ATI's video drivers and we all know how ATI's known for stable video drivers.

Great Things

  • Beyond TV - Video Qualities - Mozilla FirefoxBeyond TV 4 has an SDK available (expect a Coding4Fun article on this from me) that includes COM, .NET and more importantly Web Service support. Any ideas on what I could do with a PVR that's totally controllable via Web Service? OK, how about something Clemens HASN'T already done? :)
  • Beyond TV 4 includes (yet another) UPnP server that makes the recorded video available to other devices on your network. Personally, I've started using TwonkyVision's server and have found it excellent and more compatible than Windows Media Connect, Nero, or any others, but Beyond TVs is meant to work primarily with their Beyond TV Link product. Beyond TV Link lets you install a small client on machines in your house that don't have a TV. It's a "Media Center Extender" that is specific to Beyond TV.
  • Beyond TV has a crapload of advanced features, most made available in the Web Admin. I like the "ShowSqueeze" option that takes my 1 hour=3 gig MPEG2 files and makes them WMV file overnight. I squish those onto the PSP.
  • It also added support for DivX as a target format along with a million other formats (see screenshot at right)
  • You can use the Web Admin as a zero-install web-only client to watch recorded shows and Beyond TV will automatically transcode (squish) them on the fly as it streams them to you. This makes it possible for me to watch my recorded TV from a hotel after VPN'ing in to the house.

All in all, it's a great product for the money despite my complaints. I used Beyond TV 3.5 daily for over a year without trouble, and I'm confident Beyond TV 4 is an improvement on 3.5. The MAJOR feature that was added in Beyond TV 4 that I wasn't able to test is its support for HDTV. I had an ATI HDTV All-In-Wonder but it was such a complete piece of crap that I took it back. Perhaps I'll try to get my hands on some of the newer generation HDTV cards and add to this post.

If you've got an existing machine and you're even slightly thinking about a Media Center PC, just spend the ~$150 and get a Tuner/BeyondTV bundle. Seriously, I know lots of folks out there who are looking seriously at MCEPC's for more than $1000, but could really save some money with a simpler product like Beyond TV 4.

Now playing: Original Broadway Cast "Rent" - Take Me or Leave Me

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

ClickOnce and FireFox with a custom setup equals ClickThrice and be disappointed

November 12, 2005 Comment on this post [11] Posted in ASP.NET | Javascript | XML | Bugs
Sponsored By

ClickoncescreencastthumbnailChris Sells via Michael Weinhardt ported Wahoo (a Tetris Clone) to ClickOnce/.NET2.0. I happily visited and attempted to download, expecting to click once. I run Firefox as my default browser and am currently running FireFox 1.5 RC2. However, Brian Noyes via Greg Robinson says

"ClickOnce does not have a dependency on browser flavour, so it should work with Firefox or IE (5.0.3 and up), provided the FX 2.0 is installed."

so I figured I'd be OK. But, just to be careful, I loaded up IE and ran it from there. Here's the result as a screencast.

There are two ways to launch this particular app. You can launch the setup.exe that confirms you have Windows Installer 3.1 (a requirement of MicrosoftUpdate.com) or you can launch it directly via the .application file. The application's manifest gets sent based on it's mime/type to the ClickOnce engine, dfsvc.exe. This application is responsible for reading the manifest and downloading the application into a per-user*per-application cache in C:\Documents and Settings\<you>\local settings\Apps\2.0. The application.manifest mime-type is application/x-ms-application and if you look in Windows (not Internet) Explorer's FileTypes dialog you see that it's open command is "rundll32.exe dfshim.dll,ShOpenVerbApplication %1" which tells rundll32.exe to call the ShOpenVerbApplication method on dfshim.dll also known as the Application Deployment Support Library. Since the setup.exe is calling ShellExecuteEx, it seems that Firefox as the default browser gets first dibs.

Note that the setup.exe isn't a requirement of ClickOnce, just a decision that MichaelW made to ensure a certain prereqs are available. (UPDATE: This has since been updated on the site but still doesn't work in FireFox) The ClickOnce deployment creates a .html file that does some interesting javascript in order to "do the right thing." The Javascript parses the UserAgent, looking for the presence of the CLR. This works on IE because IE's UserAgent string is modified when you install the .NET CLR and various other things. For example, my IE UserAgent is "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727; Avalon 6.0.5070; WinFX RunTime 3.0.50727)" while my FireFox one is "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051107 Firefox/1.5".

UseragentmodifiedNOTE: These User Agents are added in a list in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\
Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform
. See screenshot at next.

THOUGHT: Seems to me that FireFox on Windows could save us a hassle if it would respect and use this list in its own User-Agent string.

function Initialize()
{
  if (HasRuntimeVersion(runtimeVersion))
  {
    InstallButton.href = directLink;
    BootstrapperSection.style.display = "none";
  }
}
Opening Wahoo.applicationfunction HasRuntimeVersion(v)
{
  var va = GetVersion(v);
  var i;
  var a = navigator.userAgent.match(/\.NET CLR [0-9.]+/g);
  if (a != null)
    for (i = 0; i < a.length; ++i)
      if (CompareVersions(va, GetVersion(a[i])) <= 0)
		return true;
  return false;
}

Nutshell is, one page is generated by the deployment wizard, but different browsers get different client-side-modified pages based on this (and other) Javascript.

OperaClickOnceInterestingly the identical problem occurs when I use Opera 8.0. It downloads to a temp folder and runs, failing in the exact same way. Both Opera and Firefox download to the Local Settings\Temp, while IE downloads to the bowels of Temporary Internet Files\schmutz.

Hacking

I opened the XML-based .application file and noted this:

<dependentAssembly dependencyType="install" codebase="Wahoo_1_0_0_16\Wahoo.exe.manifest" size="10640">

which was mentioned in the error log file

 * Activation of C:\DOCUME~1\shanselm\LOCALS~1\Temp\wahoo-5.application resulted in exception. Following failure messages were detected:
  + Downloading
http://www.hanselman.com/blog/content/binary/Wahoo.exe.manifest did not succeed.
  + Could not find file 'C:\Documents and Settings\shanselm\Local Settings\Temp\Wahoo_1_0_0_16\Wahoo.exe.manifest'.

So, I downloaded http://www.sellsbrothers.com/wahoo2/Wahoo_1_0_0_16\Wahoo.exe.manifest and saved it to C:\Documents and Settings\shanselm\Local Settings\Temp\Wahoo_1_0_0_16 manually. Then I tried to run Wahoo.application again from FireFox and everything worked. Seems to me that could be a security hole. Dfsvc.exe shouldn't be thrilled to find a file it was responsible for downloading already present in the folder it was responsible for populating. I would have expected a failure to download, not success just because I did its work for it. However, what do I know about security? I tried to edit the .application file and of course was greeted with a tamper proof label, as expected:   

System.Deployment.Application.InvalidDeploymentException (SignatureValidation) - Manifest XML signature is not valid.

That's comforting, though.

No conclusion here yet, folks. I was unable to get either the setup.exe version or the .application version to work any on of three machines, all running FireFox as the default browser. Of course, if I switch to IE as the default, everything works great.

Seems to me that I should be able to download and click on a .application file anywhere and have dfsvc.exe just handle it, copying things to wherever it needs to. It doesn't seem to expect to have .application downloaded to other locations.

Good news is, it's been reported as a bug and I expect we will here something soon. I'll post as soon as I get more info. Feel free to comment if I've gotten something wrong.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Request.Browser.Version may not be a double

November 11, 2005 Comment on this post [7] Posted in ASP.NET
Sponsored By

Avoid writing code like this to do browser detection:

if(Double.Parse(Request.Browser.Version) < 5.2) { // 5 or less

Why might this be a problem? Well, Request.Browser.Version is typed in the Base Class Library as a string. It's a string for a reason - because it may not necessarily be a double. When one writes Double.Parse(someString) they're basically saying that the folks who chose the type for Request.Browser.Version were mistaken, and that a double would have been a better chose.

This can be a problem when a browser like IE7.0 beta comes out and the value of Request.Browser.Version is "7.0b." This also applies to Mac's Safari and its User agent version which changed recently from 2.0 to 2.0.1 or 2.0.2.

Exception: Input string was not in a correct format.
Exception: System.FormatException
Message: Input string was not in a correct format.
Source: mscorlib
at System.Number.ParseDouble(String s, NumberStyles style, NumberFormatInfo info)
at System.Double.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.Double.Parse(String s)

Unexpected exceptions tend to cramp one's style. I like the philosophy that "if you ever get an unexpected exception, you didn't test your code well enough." Why? Because clearly it wasn't anticipated, otherwise there'd have been code to handle it. This line (and the code around it you can't see) never expected a non-double to be in Request.Browser.Version, but the property's string type was the first tip that other things could happen.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.