You are currently browsing the category archive for the 'Uncategorized' category.
Just posted a new entry on adding properties to a WCF behavior that get their values from the config file.
http://steverb.com/post/2008/11/25/Passing-Configuration-Values-into-WCF-Behaviors.aspx
Behaviors in WCF are so stinking useful, and once you get past the basics of WCF they’re arguably a necessity. Microsoft has saved itself from hundreds of hours of cursing by including the ability to define custom behaviors.
So far, my favorite use of behaviors is to use them to address some cross cutting concerns that we consistently have to address in our WCF services. Specifically logging, service registration, wsdl tweaking, and error handling. Which brings us around to the IErrorHandler interface.
I’ve moved to my own domain, finally.
I spent an hour last night fighting with the free wordpress account to try and get code to format properly, to no avail.
I used Windows Live Writer tonight, with no luck.
So I’ve gone ahead and bit the bullet. I’m now the proud owner of steverb.com, where this blog will be moving in the next few days.
Stay tuned.
I’ve been working with WCF a fair bit lately, and frankly it’s mostly been a breeze. I did run into two head scratchers that I thought I would document since I had a hard time finding a straight answer on the intertube.
The first one has to do with WCF and Microsoft Enterprise Library. If you don’t know what Microsoft Enterprise Library is, it’s basically a collection of code that everybody keeps writing over and over again. Stuff like logging, error handling and database connectivity. If you needed that explanation, then you should quit reading this and go download it. Seriously, this blog will still be here when you get back.
Got it installed? Skimmed the documentation? Good, now you can stopwriting all that code that everybody gets almost right and go back to doing useful work.
So, using the logging block with WCF is fairly straight forward. Just make sure whatever process your service is running under has access to the db, and to the stored procs. I know, I’m an idiot. Of course it will need access to the stored procs. No, giving it access to the tables won’t magically give that login access to the stored procs. I know it’s stupid, but when I was trying to find out why my logging wasn’t working I saw the same question over and over again, and never saw an answer.
Just so you don’t have to look it up, if you ran the standard sql script to add the table and stored procs, then the stored procs are named: AddCategory, ClearLogs, InsertCategoryLog and WriteLog.
The other big, bone headed gotcha I ran into was during integration testing. For some reason, none of the changes I made to the service to fix things seemed to take effect. I restarted the service, I restarted the server, I restarted the computer. I stepped through the tests, I attached a debugger to the service and could never get it to hit a break point. I stopped the damned web service, and still my tests kept coming back with the same results. After reconfiguring the web service reference and making sure it was pointing at localhost (where I was testing) I still couldn’t get a breakpoint to hit, or see any of my changes taking effect in the code.
Yeah, you’ve already figured it out. The web service reference was pointing to the wrong box. Well, to be more accurate, the settings for the web service reference in the app.config for the tests were pointing to the wrong box. Even though the configuration for the web service reference said it was pointing to localhost, a quick look in the app.config showed that it was pointing to the box of another team member who had also been working on this web service.
If you point the web service reference to localhost, visual studio is “smart” and goes behind your back and inserts the actual machine name in there. I changed all the references in app.config to localhost as well, and suddenly all the changes I had made started working. Amazing! It only took me two hours of beating my head against the desk to figure that out.
Hopefully, the spiders find this entry and keep you from having to do the same.
If you liked this, check my other posts at my new site http://www.steverb.com.

I got handed a nicely interesting project and given mostly free reign to use whatever I wanted to for it. Of course, the first thing I did was look at .Net 3.5 and ask myself what seemed cool that I haven’t had a chance to play with yet. LINQ was the obvious first choice.
I decided to try using LINQ to SQL in the data access layer. It seemed like an obvious thing to do, but a funny thing happened on the way to finishing up the app. It looked more and more like LINQ to SQL shouldn’t be in the DAL, but that it should replace it.
So far so good. And I have to say, after using LINQ for a week I don’t ever want to go back to writing T-SQL again. The syntax is little yoda-ish at first, but after a short warming up period I find myself using it everywhere, not just for SQL.
I’m still not sure how well LINQ to SQL will hold up as the app ages and expands, but my first gut is that it shouldn’t fare any worse than with a traditional DAL.
BTW, I was joking about the other TLAs. Three is enough.
So, I’ve left Edfinancial and am at Bechtel now.
I’d forgotten how annoying changing jobs can be. New paperwork, gotta move all the crap you’ve accumulated, can’t remember where the damned bathroom is.
Life is good!
That’s all really. I’m learning a lot about CRM development, but not as much as I would like.
Most of the talks are tech-lite.
I’m a big fan of the Moleskine (5.25 X 8.25) notebooks, and I’ve gotten to the point now that I feel lost if I happen to leave the house without mine. I’ve finally got a time and information management solution that works for me. It’s hard to convey how liberating it is to know that you don’t have to remember everything. Of course, like every other geek, I’ve got a system.
The pristine blankness of a new notebook can be intimidating. The urge to only write really deep, worthy thoughts is fairly common. So, I start out by completely obliterating that idea nad writing on every other page. That is, I number the odd pages. I’d number them all, but frankly that’s a lot of work, and having the odd pages numbered gives enough information to find whatever page number I’m looking for.
After the odd pages are numbered I flip to the very last page and title it “Index”. The index starts at the back and goes toward the front.
The first page gets a line right down the middle, and then a horizontal line across the top with enough space to write the date in.
I tape a small yearly calendar to the inside front cover with special dates (birthdays and holidays) marked on it. Below that stick four or five post-it notes and chuck a couple of 3X5 index cards in the back pocket.
That’s all the set-up. For actual use, the left hand column of the page is where I write down stuff I’ve done. Usually just a dash and a title works for me. The right hand column is for the day’s reminders and stuff to do. Every morning, I draw a new set of horizontal lines for date and start over. Any reminder’s or “to dos” that didn’t get completed the previous day immediately get copied to the next column. At the end of the day, I put an entry in the index noting the page number, the date and anything special I might want to refer to.
If I get a rash of ideas for a project I just go forward to the next page, title it and put an entry in the index.
That’s my system. What’s yours?
