Welcome to MSDN Blogs Sign in | Join | Help

ToddHa's WebLog

Musings, notions, thoughts about technology and software.

News

  • Disclaimer
    The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
When Fixes Cause Problems

Note that there are tons of stories about backwards compatibility; for some of the best go see Raymond.

For a sample application that I'm writing, I'm using .NET CF 3.5. I had upgraded from the version shipped with Visual Studio 2008 Beta2 to the one shipped in VS2k8 RC1, and I hadn't had any problems. Take note, because if you've written some buggy code and are unaware of it, this may affect you, too (perhaps even coming from .NET CF 2.0 code).

This morning, I upgraded from VS2k8 RC1 to VS2k8 RTM and all of a sudden, none of my network requests were working -- they ALL timed out.

I kind of freaked out for a bit, thinking that it couldn't have been my code -- I didn't change anything! Plus, as a developer, I've learned the hard and fast rule that it's never my code -- it's always somebody else's. :) However, I was on a new machine, so I hadn't set up ActiveSync to my emulator. I convinced myself that AS was having issues and my PocketPC phone wasn't getting good service.

An hour or so later, I realized it was my code.

In my app, I have a rudimentary BizTalk Connectivity Services aware engine (although isn't specific, as it uses simple HTTP PUT/GET/POST) which takes a URL. This URL is given by the user, so there has to be some checking done on it. Mostly, this is done for me by the framework, but the one key addition which I added was checking to ensure that the URL had a trailing '/' at the end.

 

Thus,

http://connect.biztalk.net/services/username/service

turns into

http://connect.biztalk.net/services/username/service/

 

Then, internally my operations all have corresponding URL I should append to the end. However, the bug in my code was that all of the URL operations START with a forward slash. So after I glued the different pieces of the URL together

 

"http://connect.biztalk.net/services/username/service/" + "/Operation"

I would get:

http://connect.biztalk.net/services/username/service//Operation

 

Apparently in the older versions, this would work fine. But in the version shipping with VS2k8 RTM, it won't work. Simple fix, but caused havok with me for a while. Fortunately, I hadn't released it, so it was easy enough to catch and fix.

Posted: Friday, November 30, 2007 1:46 AM by toddha

Comments

Anonymous comments are disabled
Page view tracker