net, vs, testing, wcf comments edit

If you’re developing as a non-admin user and writing WCF services (or supporting entities like behaviors, etc.), you probably not only are unit testing the code but also want to write an integration test or two that actually fires up a real WCF service, makes a couple of requests, and validates the responses.

You may also have seen this exception:

System.ServiceModel.AddressAccessDeniedException : HTTP could not register URL http://+:1234/ServiceUnderTest/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).

Following that link, you’ll see that the reason you can’t start your service listening to the port/URL you chose in your test fixture is that you’re not running as admin. You also see some instructions telling you how to grant the user the rights to use that URL.

There’s an easier way and it doesn’t require permissions changes.

There is a special temporary URL base that anyone can use. Instead of starting up your service on an arbitrary port or URL like “http://localhost:1234/ServiceUnderTest” try putting the test service under “http://localhost:80/Temporary_Listen_Addresses/” like “http://localhost:80/Temporary_Listen_Addresses/ServiceUnderTest”. You won’t get prompted for credentials and things will run just fine on your local machine without having to grant your developer user any additional permissions.

This is one of those things that I figured out, forgot, figured out, and forgot again… and now I’ve figured it out one more time. This time I’m blogging it so I hopefully don’t forget.

traffic comments edit

It’s been a while since my last traffic-related posting, mostly because my commute in recent years has been pretty short so I don’t have those “Traffic Asshole of the Week” moments to post. Today, though, I found THIS guy:

20 in a 45? Sure! Why
not? 

This giant GMC truck made my traffic day. If you, too, want to make my day in the same way, here’s how:

  1. While I’m going a full 45mph, wait until I’m a little less than half a block away and then do a left-hand turn out of a side street and cut me off.
  2. Once you’ve cut me off, make sure and go somewhere around 20mph in a 45mph speed zone. Be sure this is in a no-passing area, too, so there’s no way I can get around you.
  3. Do not put on your emergency flashers to indicate you’re going slow on purpose. Make sure that, by all appearances, you’re really just not paying any attention at all to the whole “driving experience.”
  4. Stop for every green light. Seriously. Stop for anything that says “go.”
  5. Every time I signal to change lanes, to get around you, go ahead and, without signaling, change lanes in front of me into the lane I was going for.

After I finally got around him (where there were finally two lanes), I looked in my rear view mirror and saw cars passing him in one lane like he was standing still… and somewhere over 10 or 15 cars piled up behind him, waiting for a chance to jam into the next lane and get around.

Dude, you are the single-handed reason for traffic. Pull over to the side of the road, take the keys out of the ignition, and throw them as hard as you can into the scrub. Walk home. You are fired as a driver.

net comments edit

Ran into this yesterday and took a little bit to figure out:

I can run unit tests through NUnit or TestDriven.NET just fine… but if I run those same tests throughNCover, I get a System.Security.VerificationException - “Operation could destabilize the runtime.”

I searched around and found that the exception comes up basically when the JIT can’t verify type safety of an assembly or when it tries to run something in medium trust that should be running in full trust. I also found another person who ran into something similar.

Turns out I had marked my assembly with AllowPartiallyTrustedCallersAttribute (for various reasons I won’t get into) and that was causing problems when NCover tried to instrument it. Removing the attribute fixed the issue and I could get coverage running.

Long term that’s probably not the best solution and I need to learn more about the new .NET 4 security model to figure out what really needs to happen, but if you’re seeing a VerificationException when you run tests under coverage but you don’t see that exception when you run without coverage… check your security attributes.

android comments edit

Now that I’ve got my calendar/contact sync issues pretty much resolved, I’m starting to think about moving to an Android-based phone. You know, because I can’t leave well enough alone.

Apparently Amazon has opened a new wireless store, which is interesting, and looks like, at the very least, a sort of vendor-neutral place you can see what’s out there. My current leading choice, since I’m on Verizon now, is the HTC Droid Incredible. The speed and screen are appealing, and the camera is hands down better than my crappy Blackberry Curve camera (even if the Incredible gives things a slight blue tint).

Maybe in a couple of weeks or so, when I have a weekend free to head in and switch. I’ll need the weekend to get myself all set up. :)

personal comments edit

It’s not my only problem by any means, but it’s a big one.

I’m a perfectionist. I admit that. I’m also an engineer, the side effect of which means I’m always trying to make stuff better in some unquantifiable fashion.

I’ve blogged before about my media center setup and some of the issues I’ve run into. I’ve also wondered aloud at how non-geeks survive and all the fiddly shit that comes along with getting all of these devices and things to work together.

Recently I’ve moved my DVD library off my Windows Home Server onto a Synology DS1010+. In doing that, I think I figured out some of the reliability issues my home server was running into, so I almost have the system nice and stable.

In the back of my mind, there’s a voice. It’s asking me, “What can you do to make it better?

I know, consciously, that I need to stop messing around with the damn thing because it’s working perfectly. Subconsciously, though, is the constant drive to enhance.

How can I make the network faster? This would involve getting gigabit adapters for devices that don’t have them, fiddling with jumbo frames, setting up dual-band wireless-N for the devices that need it… but the network, while it could be improved, is at least reasonably stable right now and doing some of those things is just going to upset equilibrium.

How can I improve the media center front end PC? I think it’s underpowered and some of the drivers are out of date because the devices don’t all have recent 64-bit drivers… but they do have 32-bit drivers, so do I step the OS down to 32-bit, get a different system, or…? But it does what it needs to just fine - play DVD images off the network.

How can I make the home theater easier to use? I have a reasonable remote control right now and it’s not that bad to switch on the various components, but it’d be nice to have something like a Harmony One to round out the functionality. Of course, that involves the setup and maintenance of an additional piece of equipment, plus training costs (if you know what I mean).

…and so on. Do any of these things really need to be dealt with? No. Does something inside me drive me to want to? Yes. And, of course, doing so will create work - work that, once I’m in the thick of it, I really wish I didn’t have to do. Like I’m punishing myself for something.

I really need to learn to just leave well enough alone.