Expert Texture Home Contact me About Subscribe Digipede Connect on LinkedIn rwandering on Twitter rwandering on FriendFeed

rwandering.net

The blogged wandering of Robert W. Anderson

Archive for September, 2005

Changing CLR Version with ILMerge

Here is a trick that I found while looking at ways to handle .NET 2.0 while continuing to support .NET 1.1. The obvious way to support both is to build with VS2003 and use application configuration to direct the loader to prefer .NET 2.0 if available:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedruntime version="v2.0.50727">
      </supportedruntime><supportedruntime version="v1.1.4322">
    </supportedruntime></startup>
</configuration>

That is OK, but what if you want to bind your assembly to .NET 2.0 and you don’t have the time to re-engineer your build and release processes?

OK, that is a lot of ifs, but it occurred to me that maybe ILMerge might work. ILMerge merges multiple assemblies into one, but what if it works with a single assembly? It turns out that it does:

  ilmerge input.dll /out:output.dll

creates a new assembly that is bound to the CLR that ILMerge is running. Of course, it is stripped of its strong naming key and signcode key; so you have to deal with this seperately.  The good thing is, though, that all of your resources (both managed and Win32) are in your resulting PE.

Of course, you can use ildasm and ilasm to do this too, but it takes more steps (or at least more attention to the arguments) to get the intended result.

Tags: , ,

FileInfo behavior change in .NET 2.0 Beta 2, fixed in RC

The other night we were performing tests of the Digipede Network on .NET 2.0 Beta 2 and came across an unexpected failure. The failing code instantiated a FileInfo object with the fileName argument of a nonexistent file. Then the code read the Attributes property. This resulted in the following exception / stack trace:

Unhandled Exception: 
  System.IO.FileNotFoundException: 
  Could not find file 'xxxxx'.
  File name: 'xxxxx'
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath
      at System.IO.FileSystemInfo.get_Attributes()

The code was supposed to read Attributes only if Exists was true. This was clearly a logic error, but my first question was: “How does this ever work?” As I didn’t have time to look into it further, I just went ahead and fixed the problem.

Today I tested this code again in .NET 1.1 and found that Attributes returns a default value (all bits on) even when the file cannot be found. I looked this up in the BreakingChanges.chm (that hasn’t been updated since May) and found no reference to this change in behavior.

I decided to test it again on .NET 2.0 Beta 2 (v2.0.50215) and confirmed again that I get the above exception. This appears to be an unintentional breaking change to Beta 2.

Then I tried it with the .NET 2.0 RC (v2.0.50727, the one from the Visual Studio 2005 RC that was handed out at ). This time it worked just like it did in .NET 1.1.

So, the problem came and went.

I figure that the Beta 2 behavior was reasonable; however, the CLR team apparently (and, I think, correctly) prefers compatibility.

Here is the code sample I used to test this out:

using System;
using System.IO;

namespace FileInfoTest {
  /// 
  /// Summary description for Class1.
  /// 
    internal class FileInfoTest {
    /// 
    /// The main entry point for the application.
    /// 
    [STAThread]
    private static void Main(string[] args) {
      // check arg length
      if (args.Length != 1) {
        Console.WriteLine("Usage: FileInfoTest file");
        return;
      }
      // get FileInfo
      FileInfo fileInfo = new FileInfo(args[0]);

      Console.WriteLine("Exists:\t{0}", fileInfo.Exists);
      Console.WriteLine("Directory:\t{0}", fileInfo.DirectoryName);
      Console.WriteLine("Name:\t{0}", fileInfo.Name);
      Console.WriteLine("Attributes:\t{0}", fileInfo.Attributes);
      Console.WriteLine("LastAccessTime:\t{0}", fileInfo.LastAccessTime);
      Console.WriteLine("LastWriteTime:\t{0}", fileInfo.LastWriteTime);
    }
  }
}

Tags: ,

My interview with DOC | HOLLADAY

I talked with David Holladay at  (i.e., DOC | HOLLADAY). Today he published the interview here.

I talk a bit about what Digipede does and what makes our product different from other Grid offerings out there.  I also talk a little bit about the background of my team and what got us interested in this market space.  At least I think that is what talked about — I haven’t watched the interview myself!

Tags: , ,

Dan shows off the Digipede Network

Dan’s “Grid Computing for Windows” show-off video was just posted on Channel 9.  Check out how easy it is to grid-enable your applications with the Digipede Network.

Good job, Dan!

Tags: ,

From MTC to eScience

Dan blogged that he would rarely post this week because of our work at the MTC in Mountain View.  Boy, was he right — it has been pretty consuming.  So, I’ve been quiet too.

We’ll be heading up to the MS Research eScience event next week.  I’ll be blogging about that soon enough.  If you’ll be up there, contact me.  It’ll be a whirlwind trip for me, but it looks like there is a bit of “meeting“ time in the schedule.

Hope to see you there!

Tags:

Please update your feed!

Dan noticed that he was no longer getting posts from my blog and that he had originally subscribed to the wrong feed (i.e., the Atom feed from Blogger) instead of my Feedburner feed: this one.

Those of you who originally subscribed to the Atom feed probably won’t get this post! Otherwise, please update the feed to the following:

http://feeds.feedburner.com/MindFromRWandering

I apologize for any confusion this might have caused.

Cheers!

Microsoft done for?

Robert Scoble is spending a bit of time refuting this point. The latest post is here where he refers to responses to the current company meeting.  He is in a good position to refute these claims as he has a broad view of what products are coming at Microsoft.

I do find the premise that “Microsoft is done for” a bit naive.  I’m sure people have reason to be skeptical about recent management changes, execution of new projects, and as far as I know, concerns about company morale and cohesiveness. 

But, so many are so anxious to relate the story of Microsoft’s imminent demise that they are not seeing straight.  People keep looking for the next big thing and then making the connection that is the Microsoft killer. 

Linux was going to dethrone Windows.  Well, no.  Certainly very many machines that might be running (and licensing) Windows are running Linux; however, the growth of new machines running Windows is phenomenal.  Microsoft is winning this battle.

Now Google is going to dethrone Microsoft.  How again? 

  • With the best search engine out there?
  • With the best mapping / sattellite software?
  • A new special-purpose OS (quick, everybody: rewrite everything!  Microsoft will be buried in a year!).  (Dan has recently posted some thoughts on this)
  • With new applications for Windows?  A new Word processor?
  • In the enterprise? 

I see much more opportunity for synergy between these companies than one destroying the other (I actually have tremendous respect for Google, by the way).  I can understand why there is a battle here starting with the search engine (and going down into the OS).  Microsoft wants to be the top search engine (eyeballs equate to revenues in the search market).  But, this doesn’t equate to Google causing Microsoft’s demise.

And of course, Microsoft is not sitting still and waiting to be destroyed by anybody.  Not only are they creating new products (and product features), but they are working on a bigger more connected vision that is actually pretty cool.

I think the big problem is that the Microsoft haters will always hate Microsoft.  These people revel knowing that Google and Microsoft are at war and hope they have finally chosen the right horse. 

Anyway, I think the reports of Microsoft’s death are greatly exaggerated.  (apologies to Mark Twain).

Tags: , ,

XML Intellisense in VS2005

When I was at , I was talking to Faisal Mohamood about performing distributed builds on the Digipede Network.  I had a question about Intellisense in VS2005 and he said something like “Really?  That should just work”.

Finally I have gotten to sit down and spend a few focused minutes on this Intellisense issue.  Our XSD works great in VS2003, but not in VS2005.  Lots of warnings that look like this:

Type ‘x’ is not declared in namespace ‘y’.

I made the assumption that the VS2003 schema was actually valid; but it turns out that it wasn’t.  Strangely enough, it appears that VS2003 is much more forgiving about errors in XSD than VS2005 is.  I’m happy to say that the XML validation features of VS2005 told me what was wrong with the schema and it was easy to fix.

Note: our original schema had been created using xsd.exe from a class library.   I had to tweak some things in it by hand, but basically VS2003 accepted it as it was generated.  Oddly, it had several problems in it.  The most major one (and the cause of the problem above) is that there were many top-level element nodes that should have been complexType nodes.  It seemed kind of arbitrary whether types were defined or not.  So, don’t trust xsd.exe for creating valid XSD.

Tags: ,

Newsgator Outlook Edition trouble? Reinstall!

I have been using the Newsgator Outlook Edition for the past year and was pretty happy with it, but I just realized that it has been discarding posts somewhat arbitrarily.

For example, I had subscribed to the PDC Bloggers feed and hadn’t gotten a new post since the Wednesday of the conference.  With all of the feeds I was reading, I didn’t even notice.  Several other feeds have been behaving the same way.  Newsgator online was working fine, though.  Definitely not the feeds, just the reader.

A trip to the Newsgator support site clued me into “Shift-Refresh” as a way to force a refresh of a feed.  This didn’t work.  A service release (SR2) was released earlier in the month.  Upgrading didn’t make a difference.

Uninstalling and then re-installing did work.  Now I have (unfortunately) a whole lot of posts marked as unread.  It is a good think that Newsgator can sync your feeds from the web site.  Handy feature, really.

Tags:

Microsoft wins the PDA OS war

Business Week is reporting that soon there will be an announcement of a Windows Mobile Treo.  This was expected, but now it is (almost) official:

Microsoft has won the PDA OS wars

Being an avid user of Palm OS devices since the Pilot Professional and recently a user of the JASJAR (a Windows Mobile 5 Phone), I have to say that Microsoft won this one on marketing.

That is not to say that technically Windows Mobile isn’t impressive.  It certainly is; however, the ease of use and responsiveness of the T3 stands in stark contrast to the slowness and complexity of the JASJAR.  OK, I should try other Windows Mobile devices before I make a statement about relative speed, but the overall complexity of the PIM functionality makes Windows Mobile very hard to use. 

I just don’t see how an average (non-technical, non-geeky) user could use a Windows Mobile device as their PIM.

Update: fixed a typeo and an admission: no, Windows Mobile devices are not necessarily slow.

Next entries »