Lessons Learned

"The protocol 'net.msmq' is not supported." Dec 27

OMG, a new lesson! Will wonders never cease?

So I ran into an interesting issue setting up a WCF service to consume an MSMQ queue. I won't bother you with the details of how to actually build a WCF/MSMQ service; there are plenty of tutorials on the subject. I want to share with you an interesting error that I ran into and the surprisingly simple fix. The error occurs when attempting to generate a Service Reference or even simply browsing to the WSDL of your WCF/MSMQ service in the form of a YSOD with the following error:

"The protocol 'net.msmq' is not supported."

After a lot of Googling on the subject turning up plenty of questions with the same error but no answers. So I went digging into some application level config files on a server that already had a WCF/MSMQ service successfully set up by the network admin, and the answer was amazingly simple:

If you are hosting an MSMQ/WCF service in IIS, you have to tell IIS to allow net.msmq protocol. It's in the advanced settings for the application or site in which you are hosting the service.

.... aaaand, that's it.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Computer: Tea. Earl Gray. Hot. Apr 15

I just bought an awesome geek mug and thought I'd share:

Computer: Tea. Earl Gray. Hot.

 

You can get it too, if you head over to Cafe Press.

 

 

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Windows Azure Oct 27

So, by now you've probably heard of the Windows Azure news coming out of PDC; it's rather hard to avoid the media blitz.

It looks useful. Being able to easily deploy and scale services would be a big help, frankly -- if I could ever convince the Kool-aid drinking anti-PC Penguinistas that control our network to agree to such a system. Snowball's chance.

But I've a much more pressing issue to blog about than that. All I can think of since I heard the name is "Why???!?!? Who came up with such an aztacular name?"

UPDATE: Ok, now I'm confused. As I get deeper into Azure, it appears to only be available as a remote service from Microsoft. Is that correct? Or can enterprises purchase Azure and set up their own clouds? Further updates as I learn more.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Are You a PC? Sep 26

So it turns out I'm a PC. Are you?

I've been having trouble getting into this whole I'm a PC thing. I am a PC.

But I'm also a Mac and a Penguin.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

The Name of the Wind Fantasy Cast Sep 08

If you are looking for a new fantasy novel / series, look no further than The Name of the Wind by Patrick Rothfuss. I won't bother you with a complete review; that's not the purpose of this post. But I will tell you that it's a well crafted novel and well worth the read. If you haven't read the book, this post will make little sense to you, so go buy the book and read it before you read this post. Don't worry, I'll wait for you.

Welcome back! As I said, the purpose of this post is not to provide a review of the book, but to do what every fanboy must do for a new favorite novel: list a Fantasy Cast. And so without further ado, here's my incomplete fantasy actor list in order of as I thought of it:

Kvothe
Rupert Grint -- I honestly picture him when I try to picture Kvothe. He'd have to be less goofy in the movie than in his other major roles as Ron, Ron, Ron, Ron, Ron, Ron, Ron and Ron. Ok, so he's done some other stuff too, but you have to admit he's kinda stuck in the role. This would be his breakaway chance. I think Rupert is up to the task.

Denna
Anne Hathaway -- Nobody charms as well as Anne.

Master Kilvin
Patrick Rothfuss -- I mean, come on, it's obvious, isn't it?

Simmon
Daniel Radcliffe -- He and Rupert just go together after 8 movies together, except now it's time for Harry to be the sidekick. Yes, I wrote 8. It turns out that Deathly Hallows will be split into two movies. Hadn't you heard?

Chronicler
Joss Whedon -- The absolutely perfect cameo. I dunno if I'd have him direct, though. If Joss directed, Kvothe would end up killed off halfway through the movie. I dunno how he'd do it, but you know that if anyone can pull it off such that one man is telling the story of his own death to another person while still being very much alive, it'd be Joss Whedon.

Bast
Nathan Fillion -- Another great cameo. He and Joss just go hand-in-hand in a totally not gay but that'd still be ok way.

Auri
Felicia Day -- Another great Whedonesque cameo. Plus, she can totally pull off sweet insane Auri.

Master Hemme
Christopher Lee -- He's just so good at being the bad guy!

Arcanist Abenthy
Ian Holm -- Others would probably put Ian McKellan into this role; why not Gandalf to play the stereotypical mentor? But I think Ian Holm fits the role better. He's just got a talent for that distracted but shrewd feel I get from Abenthy.

Ambrose
Niel Patrick Harris -- Straight from his role as the villian?-ish? Dr. Horrible, Neil Patrick Harris would add a certain j'ne sais quois to the character.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Don't Use NOLOCK, Use HOLDLOCK Aug 28

Normally I very much agree with the things Jeff Atwood has to say. In the case of this post, however, I must take issue. What begins with a decent intro into the concept of deadlocks eventually ends with Jeff deciding to use the NOLOCK table hint to allow dirty reads of a table that had been locked by an update statement. He concludes with a complaint that Microsoft seems to think that Stack Overflow is a banking institution and therefore worthy of data integrity instead of the mere programmers blog/wiki/link exchange that it really is.

Jeff wildly misses the mark with his conclusion, in my opinion.

Not only is NOLOCK deprecated, Jeff seems to believe that data integrity is something one can safely do without "in certain scenarios". He is wrong. Every database not only deserves but requires data integrity.

Of the dozens of posts that replied to Jeff's article, a few diagnosed the real issue (long updating transactions) but only one (at least as of the time of this post) supplied the correct solution (in my opinion) to Jeff's problem. The poster's name was Filip and his blog is worth adding to your feed reader. The solution Filip pointed out is simple: Lock all your resources *before* you update them and put a waiting lock on them (HOLDLOCK) so that queries that want to use the resource wait until the update is done rather than dying petulantly.

UPDATE:

Sam Saffron (also another great addition to your feed reader) has posted an excellent rebuttal of Jeff's post explaining how and why deadlocks occur when selecting against an update and how to deal with them. Read it and remember it.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Hidden Surprises in .NET 3.5 Service Pack 1 Aug 21

Ok, imagine the following situation:

You are a developer and you want to keep up with the latest technology, so you update Visual Studio 2008 with Service Pack 1, installing .NET 3.5 Service Pack 1 as part of the update. You then proceed to continue with your ASP.NET application, building a nice neat AJAXy application. Everything works fine on your box, it's awesome, the in-your-cube demos go great, everybody's happy. So you build and deploy your new hotness then sit back and wait for the pats on the back.

The pats never come. Instead, you get reports of exceptions being thrown by the application every request. Something has gone horribly wrong. It's always the same exception:
Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 
'System.Web.Extensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'.
You are stymied. You've never heard of the class; you certainly don't use it in your code. You use ScriptReference, of course; who doesn't? But what's ScriptReferenceBase? Going to the documentation for ScriptReferenceBase, you learn that it is the parent class of ScriptReference and CompositeScriptReference. What? No it isn't! The documentation for ScriptReference clearly indicates that it's parent is System.Object! What's going on here?

Then you notice the Version Information for ScriptReferenceBase: "Supported in: 3.5 SP1". It's a new class for Service Pack 1. It doesn't exist in .NET 3.5 and the documentation for ScriptReference is clearly stale.

Following a hunch, you double-check your server... yep. Due to red tape, SP1 hasn't been installed on the server. It turns out that when you compiled your code with the SP1 ScriptReference, you built a reference to ScriptReferenceBase and that class just isn't on the server. The solution is simple: install SP1 on the server.

Except you can't upgrade to SP1! Internal circumstances (i.e. no time for regression testing) means no upgrade. So no biggie; you return to Visual Studio 2008 and decide to target .NET 3.5 rather than .NET 3.5 SP1.

Except, surprise! You can't. Visual Studio will target .NET 3.0 and 2.0, but it won't let you differentiate between .NET 3.5 and .NET 3.5 SP1. OUCH.

So what do you do? At this point, your options are limited. The best option is to install SP1 on the server, but sometimes internal pressures won't allow that. Other options include uninstalling SP1 from your box and recompiling -- good luck with that one! -- and finding an unadulterated version of VS 2008 somewhere (a co-worker's box, maybe a virtual machine) and compiling there.

So why am I writing about this hypothetical situation? Because it happened to me, of course! I learned an important lesson. Maybe you can too.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Whose Fault Are Poor Requirements? Jul 28

I had thought I would do my first Lesson Learned about my control for the upcoming Silverlight Contest, but recent events changed my mind.

A phrase has been bandied about alot at work lately, a phrase we've all heard and uttered in one form or another at least once in our software careers. It exists in numerous variations, but essentially boils down to this:

"The software is bad because the requirements were bad."

I've seen it happen far too often: somebody complains that "<x> is broken" and the original developer goes on the defensive, blaming the customer for handing him faulty requirements. "It's not my fault! The customer asked for a button that rebooted the server! All I did was give them exactly what they wanted!"

I wholeheartedly disagree with this line of thinking. Claiming bad requirements is a copout.

We as developers have a responsibiltiy to find out why every feature is requested. We must get beyond that "I press a button and it does exactly what I'm thinking" requirement to the heart of the request. If you are handed a requirements document that doesn't make sense push back. Seek clarification. Learn more about the problem domain. Call the architect and tell him he's crazy, that it'll never work. And when you finally understand what the real requirement is, write it down. Save it for posterity. Communicate it with all parties. Find common ground. It can be done.

"But my boss told me to do it that way or I'd be fired!" you might say. Very true, but that's bad management, not bad requirements. That's a different copout.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Silverlight Contest Jul 24

In case you haven't heard, there's a programming contest going on. It's the Silverlight Control Builder Contest and you've still got time to play for fabulous prizes and the awe of your fellow geeks!

I'm gonna enter. Are you? Wait, you haven't had the chance to mess around with Silverlight? Neither have I!

Won't it be fun?

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

So What's This Then? Jul 24

And here it is. Another blog. Seems like everyone has one these days. Except me.

...Until now.

So yeah, I've finally decided to enter the blogosphere, whatever that is. It's not like there's anything roundish about the folks who write blogs.

Except maybe near the belly.

Ahem. Where was I? Oh, yes, blogging. So yeah, I'm blogging now. Mostly this blog will involve me posting about my pain developing software and the salves I used to soothe it. It will mostly be C# oriented, 'cause that's where I spend most of my time these days, although I may spend almost as much talking about software architecture and unit tests.

I may throw in the occasional item of interest to me so be prepared for that, too, dear reader.

Whomever you are.
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Recent Comments