Tuesday, January 23, 2007

XAML and Error MC3074

I'm lucky. Really lucky. I have frequently had the fortune to get paid to play with new technologies. Right now I'm starting a project where I get to use WCF and WPF (curses on the Microsoft drone who dropped the far cooler names of "Indigo" and "Avalon"). It's fun.

 

Of course, life on the bleeding edge is not without challenges. For starters, there's the fact that I don't know what the hell I'm doing yet. That's usually the case anyway, but what's different now is that Google can't always save me. Usually I just type in some well-chosen search terms and lo and behold someone else has made the same mistake. Only it looks like I get to go first this time.

 

At any rate, I'm working on a project that makes use of the <WindowsFormsHost> control tag in XAML. This very cool tag, shown to me by Chris Sells, allows an Avalon form to host a Windows Forms control. In my case, it's the WebBrowser control, as Avalon (I'm going to keep calling it Avalon until no one can understand what I'm talking about) has no browser control in-built. However, when I went from the sample project that Chris sent me to my project, I kept getting build failures:

 

Error MC3074: Unrecognized tag 'WindowsFormsHost' in namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.

 

After about half an hour of digging, I figured out that the problem is a missing reference. In my case, I was missing a reference to WindowsFormsIntegration, an assembly that can be found on my computer in C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0. Once I added it, all was well again.

 

Given what little I've been able to dig up on Google, I'm guessing this is going to be a common problem, so hopefully this post will help someone else at some point. Just be aware that it might not be WindowsFormsIntegration that you need to reference - I believe this error to be a general symptom of some missing reference, and not that assembly in particular. You'll have to do some detective work to figure out which one you need.

Wednesday, January 10, 2007

HoboCopy Fix: Side-By-Side Configuration Incorrect

So I was setting up one of my other machines with the new version of HoboCopy, when I got this error:

 

The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.

 

After doing a little digging, I realized that the problem was the version of the VC++ runtime I installed. I had run vcredist_x86.exe, but I had run the version that came with the RTM version of Visual Studio. Of course, HoboCopy was compiled with the SP1 version of Visual Studio, because a bug in the C++ compiler means it won't compile at all on the RTM version. Once I installed the updated vcredist_x86.exe, HoboCopy works again.

 

Of course, I had posted the wrong version up on SourceForge. I've fixed that - the version of vcredist_x86.exe available here now matches the one HoboCopy is expecting.

 

Sorry if this bit anyone other than me.

Monday, January 8, 2007

Announcing HoboCopy 1.0.0.0

Over the last few months, since I first released HoboCopy, I've been tinkering with it based on feedback from a few users, as well as my own experience using it daily. Today I posted the results of that tinkering: HoboCopy 1.0.0.0. Yes, it's stable and complete enough that I feel comfortable with the 1.0 label. You can download it from SourceForge here.

 

The highlights of the new release include the following:

 

Fixed a nasty bug. OK, you know how I said that HoboCopy would work with VSSAPI-aware applications like SQL Server to get you a consistent view of application state? Well, it turns out that I lied. I had a bug with the part of the process called component selection, and as a result the old version of HoboCopy was always giving you crash-consistent copies…i.e. whatever the hell was on the disk. That has been fixed, and SQL Server (and other VSS-aware applications) will now correctly flush their state before HoboCopy copies the files.

 

Vista compatibility. As Vista is now my main day-to-day OS, this was a must. Sadly but understandably, using the VSS API requires administrator privileges, so I had to add a manifest to HoboCopy so it'll give you that little secure "running elevated" prompt when you run HoboCopy under UAC. This sort of sucks for a command-line tool, since it launches another cmd.exe, meaning any errors immediately disappear when the process exits. Maybe I'll figure out a fix for that in a future version. In the meantime, running HoboCopy from an elevated cmd.exe is a reasonable workaround.

 

Default non-recursive processing and filename filters. You can now run hobocopy C:\sourcedir C:\targetdir *.txt *.foo to copy only files with the .txt or .foo suffixes. Recursive directory processing is off by default, so you need to run hobocopy /r C:\sourcedir C:\targetdir *.txt *.foo  if you want to include child directories as well.

 

There are a few more minor things I'd like to add to HoboCopy - specifically, to make it asymptotically approach robocopy's capabilities - but at this point it works pretty darn well for 99% of what I want to use it for, so I'm not sure it'll ever make it to the top of the project heap.

 

One more note: if you have any trouble running HoboCopy, it's probably because you don't have the VC++ runtime DLLs on your system. Run vcredist_x86.exe and try again. I've made vcredist_x86.exe available for download in the same place as HoboCopy itself.

 

Anyway, download and enjoy. Let me know if you have any problems.

Tuesday, January 2, 2007

Back and Forth

Here, as is my habit, is a review of 2006 and some thoughts on 2007.

 

I note first of all that it was a relatively light year for blogging for me. That's sort of unsurprising for a few reasons. First, I've been doing it for over three years now, so it's not quite as exciting as it was when I started. Hopefully, y'all still find it worth reading. Second, I have a toddler. Enough said. :)

 

2006 was a busy year for me, technically speaking. By my count, I was involved in at least nine different software projects. I even shipped a few of them, like the MTPS Content Service, msdnman, HoboCopy, and two releases of FlexWiki, including an alpha of version 2.0. And that's not to mention some of the work I did for some of my clients that I can't talk about.

 

Obviously, I've got more work to do in a few spots, including finishing FlexWiki 2.0 (oh ye gods, in the name of logic and mercy, please let me finish it in 2007) and shipping a new version of HoboCopy (this one's already in the can, I just need to post it).

 

The big stuff this year had nothing to do with the computer, though. First, Ellen turned two. Contrary to the popular stereotype of two-year-olds, she's been enormously fun and very well-behaved. I guess we're only two months into it at this point, but so far, two is my favorite age! But so were zero and one.

 

The other biggie was that Alice graduated. The positive impact of this on our personal lives cannot be overstated. Even more exciting than the graduation itself is that - even though I suspect she has her doubts from time to time - I'm certain than she's going to put her degree to good use in 2007, doing something really interesting.

 

As for me, I'm hoping that 2007 is a bit less busy than 2006, but just as interesting. From a work standpoint, I'm off to a good start on that one. I've got a project that I can't talk about just yet that pretty well ensures the "interesting" part, and I've finished up a few of the other ones on my list that should help with the "less busy" bit. But we'll see - I'm not historically very good at saying "no" to good opportunities.

 

In the near term, I'm very, very close to finishing my .NET architecture & design class for Pluralsight. It distills a lot of the lessons I've learned in my career - it's largely centered around the discussions I find myself having with clients over and over again as I move from gig to gig. So I think it'll be worthwhile for a lot of people. Maybe I'll see you in class sometime in 2007. :)

 

I'm not a big one for New Year's resolutions - I much prefer to strive for excellence all the time - so I'm not going to say, "I promise to blog more in 2007". More isn't generally better anyway. What I do hope is that I frequently learn new things that make me think, "Wow, I should share that with everyone" and that then I do.

 

See you around the feed.