MichaelDev
Monday, December 27, 2004
  URIs, URLs, and strings
I've been wondering why several methods in the .Net framework accept a string parameter for a URL. Furthermore, there's that whole URL vs. URI issue.

Here's an article I liked on the URI vs. URL issue:
http://www.bernzilla.com/item.php?id=100

In looking at the .Net framework classes Uri and Url, it seems they intend the Url class to be something special to use in verifying security policy on assemblies. It's part of the System.Security.Policy namespace. Furthermore, it messes with security permissions, which is a whole topic unto itself in .Net. I decided it makes more sense to use the Uri class for what I'm doing, even though I'm specifically working with a URL in this siutation. I just didn't like the fact that the Url class is tied into System.Security.Policy.

I'm designing some framework classes and want to be careful about the APIs. So, I was wondering why did Microsoft choose a string instead of using the Uri class in various places in the Framework. While I don't know the answer to that question, I found a great blog from Brad Abrams (lead program manager for the .Net framework). It's a design guideline for using a Uri vs. string.

Here's the blog: http://weblogs.asp.net/brada/archive/2004/01/12/58031.aspx

Maybe this guideline means we'll see some overloaded methods in the future that accept both a string and a Uri. Meanwhile, I'm going ahead and using the Uri class instead of a string parameter.
 
Monday, December 13, 2004
  Some things that slowed me down today...
I've been working on a web service and ran into two things that messed me up today. My web service was working fine all along; it was just the code behind doing some things wasn't.

Problem #1: Strong Name Identity Permission
I've been reading a little more about RUP and have taken some of its recommendations to heart. So, in developing this web service, we're tackling the risky and difficult things first. In this case, it's making sure the web service works properly and can return the necessary information. We're also trying out deployment scenarios now to make sure we really can deploy and install the thing as we intend. This involves fun with the DNS and Windows Installer (we're using Wise for the installer).

So, our little web service merely grabs and Xml file and returns it. When it's all done, it will grab stuff from the database, etc. However, for now, the Xml works great. We can work on our bigger risks. Getting the real return stuff out of the database for the web service to return is a triviality.

The basics of the web service were working fine. Now I needed to add encryption. We have some company framework code, and one of the classes takes care of encryption. When I added in this code, the web service stopped working.

This was driving me nuts. Unfortunately, I was trying to debug this with just running the web page that comes up when you go to the .asmx page. It seemed simple enough. But I was now getting errors.

I finally went back to the test app I had written and decided to try communicating with the web service from it. This proved very helpful. Now I got a real exception back from the web service and could see what was wrong: I was getting a security exception. One look at it and I knew what I had forgotten to do. We use Strong Name Identity Permission on our framework code (I should know; I put most of it there). Well, I had forgotten to add the AssemblyKeyNameAttribute to the AssemblyInfo file. Once I put this in the new project, everything worked like it should. I wish I'd solved the problem a little sooner, but the good news is that I solved it!

Problem #2: XmlTextReader
While experimenting with the above, I changed some text in the Xml file that was being returned by the web service. One time I did something that wasn't good Xml. When I used the XmlTextReader to load it into an XmlDocument, it threw an exception. Of course, this made it pass over calling the XmlTextReader.Close() method. This turns out to not be a good thing!

If Close is not called, the operating system will still think that an application is accessing the file, even if the XmlTextReader class goes out of scope and even if the application that called it shuts down! I could not now edit my Xml file to fix the problem I had introduced.

With a quick fix of the code (putting the Close in a finally block), I ran it again and got the error, but at least this time the file was closed so I could now modify it (or delete it). It was a heck of a lot faster than rebooting!
 
Thursday, December 09, 2004
  Outsourcing Lessons Learned
I keep meaning to jot down a few things that will hopefully help in future outsourcing projects:

Of course, a lot of these things are just a part of good software development practices, anyway (but many organizations don't have a lot of good practices). If you have good practices in place, it's a lot easier to add something like outsourcing. When everything is chaos internally, guess what? that will probably migrate to working with your outsourcing partners, too.

It's important to have a good relationship with your outsourcing partner. Don't be trying to nickel-and-dime things. We had many places where we could have done better, but, thank goodness, we had a good relationship and things went well.


 
  ADO.Net DataSet to ADO Recordset(VB)
We were just talking about doing this at work: using .Net to get recordsets, turn it into XML, and then import it into some old VB code. I figured we could probably do some kindof XSLT to make it happen.

Someone did a little search and came up with an article from Microsoft on how to do this. What a great find:

http://support.microsoft.com/default.aspx?scid=kb;en-us;316337
(previously published under Q316337)

 
Wednesday, December 01, 2004
  Visual Studio Program Manager Blog
I stumbled across this when Googling today. It's the blog for the Visual Studio program manager:

http://blogs.msdn.com/jledgard/
 
Various notes on software development. Currently using C# and .Net. May also include comments on the overall software development process, etc.

Name:
Location: Orange County, California, United States
ARCHIVES
June 2004 / July 2004 / August 2004 / September 2004 / October 2004 / November 2004 / December 2004 / January 2005 / February 2005 / March 2005 / April 2005 / May 2005 / September 2005 / October 2005 / November 2005 / January 2006 / February 2006 / April 2006 / May 2006 / June 2006 / March 2007 /


Powered by Blogger