Category Archives: dotNET

Whidbey’s FtpWebRequest Class – hooray

I struggled with webclient for a while trying to ftp and naturally, I blogged about it.

Enter  System.NET.FtpWebRequest as well as my favorite sentence in its’ remarks: “You can also use the WebClient class to upload and download information from an FTP server.”

Though I still have to play with it to believe it!

Michael Lane Thomas also gets into the FtpWebRequest class in his excellent article in Code Magazine. If you don’t recognize the name, it’s probably because you know him as “The .NET Cowboy”.

Focus of my BCL talk

I think that the focus of my BCL talk (here and here) has finally congealed. My talk is supposed to be about level 200 +. My target audience corporate developers (not plumber types) who may already be using .NET or might not even be there yet. So the focus of my talk is going to be that Microsoft has figured out what things people are struggling to do. A lot of these things are those that the average developer would never attempt or may just not be familiar with. However, the tasks that are being accomplished should absolutely be part of every developers “quiver” (as we say in the ski-bum world). A perfect example of this is the DoubleBuffered property of the windows.forms.control (and it’s counterpart the new System.Drawing.BufferedGraphics). It helps reduce flickering by parlaying the graphics data to a buffer and then when it is all together, flipping it back to the display. Skilled developers with graphic intensive applications have realized a need for this and gone to the effort of orchestrating code to make this happen. The average developer might just accept a little flickering in their form and be done with it. But a simple property like this will now help that average developer put a little more polish in their application. And therefore I feel like it is my mission (in this talk) to help ensure that the average developer does not miss out on the fact that these very simple solutions now exist to help them be above average.

Choosing what to put into under one hour on the Whidbey BCL

I have a lot of fun discovering what’s new in the base class library for whidbey. Besides just digging through the documentation , there are some other great resources.

Kit George’s PDC presentation (using bits that are different that from what we have)
Newgroup discussions
Michael Lane Thomas article in Code Magazine
BCL Team page on GotDotNet (code, articles, demos, etc)
BCL Team Blog

and of course lots of weblogs of other people in discovery mode, too.

Also, I have learned a lot from some of the comments in some of my own posts, as well.

Everybody has a different set of things that they think are cool when given a time or space limit and you really have to select.

So my EdgeEast talk has to be 45 minutes (though I’m at 4:00 pm with nothing after me, so maybe my time is longer) and I have to go through the list of everything that I found interesting and pick and choose from there what I will talk about, demo on, breeze by or or just have to skip for now. I think it would be a lot more fun if my talk was 8 hours long!!

When the dataset class of your XSD disappears

It took me some time to figure this out and now I feel like a dope, but I figure I would stick this in here for the next poor sot who has a similar brain …ummm.. gap.

I added some fields to a typed dataset. Since my brain was in sql data mode, I tagged one of the fields as a char rather than a string. No error message. Except the class file disappeared, my application wouldn’t compile because the class no longer existed.

I toggled the “Generate Dataset” option on and off and on and off to no avail. I viewed the xml. I closed and opened the project. Finally I tried “Preview Dataset” and it gave me a wierd looking error message but luckily the word “char” caught my eye and I saw the light.

Hope this helps someone googling for the same problem someday.

Common Problem Deploying WSE dependent Client Applications

Well, I bet it’s common though I only found ONE post on the whole internet about it so I better add a little noise here, too. This is for WSE1.0. I will ahve to look into this in WSE2.0! I installed my client app onto another machine. It’s not on my domain so was synching against the internet time (a setting in Adjust Time/Date). My dev machine was synching against my own server which was +6 minutes.

(I’m starting to think of some UTC posts Clemens Vasters wrote a while aback that mystified me at the time…I’ll have to look )

Anyway, I was very quickly getting a Microsoft.Web.Services.Timestamp.TimestampFault error with teh message “Message Expired”. And the reason for this was that they tiem on my client app’s box was probably very different than the webservdr it was going out to (different also than my own domain). The easy solution is to set the timeout to “0”  (i.e. no time-out) on waiting for a response from the web services, but that’s not good to me, because I don’t want to make the user sit around all day waiting.

For now, I will just have to control this by controlling the installs (still not released yet) but eventually I will want a tighter solution. Thanks to Peter Bromberg of Egghead Cafe who answered the original question in the above referenced thread. That’s my kinda egghead! 

Whidbey and my favorite Method…GetDateTimeFormats

I have written in the past about my favorite little method in the BCL – GetDateTimeFormats. There is only one thing that bugs me about it. You have to return an array and then get the element out of the array. For example

dim strArray() as string=now.getDateTimeFormats
dim myFavoriteFormat as string=strArray(1)
  (1 happens to be like this 1/20/03 in the en-US culture setting)

But I always want to type it like this:

dim datewithMyFavoriteFormat as string=now.getDateTimeFormats(1)

I finally got around to seeing if Whidbey does this but it doesn’t.

add: And then I wrote this post and learned that I still have  a LOT to learn about arrays – after only 20+ years of programming!! Many are happy to show me the way!!

Dim datewithMyFavoriteFormat As String = (DateTime.Now.GetDateTimeFormats())(1)

Kate Gregory and Scott Mitchell Interviews

By way of Amy Sorokas , I find this interview about the wonderful, Toronto-based, Kate Gregory (also an MSDN R.D.) that is titled so:

Widely Regarded, Internationally Renowned Developer on: .NET, XML, UML, C++, Java, ASP, VB, Perl, Internet, Web services…

and here’s one of Scott Mitchell (4 Guys from Rolla), too:

Renowned International Development Expert on ASP.NET and Microsoft Technologies…

These are coming from Stephen Ibaraki who has interviews with a lot of well-known geeks. He also presented at Comdex in November on Building Business Models for Web Services. So if you don’t know the name, he’s one experienced, smart and well-connected guy.

Visualizers in Whidbey

In a few posts about debugging in Whidbey, I have asked questions that were responded to in my comments with one magic word “Visualizers”. Watch for an upcoming MSDN article by the Program Manager for the debugging team, Scott Nonnenberg. Apparently bits and pieces of it are in the PDC release but undocumented.

Also, you should be able to see some of this magic in the Advanced Debugging Techniques session from PDC which I have to invent some extra time to watch myself.

Learning WSE2 – Step 2 and policies

Matt Powell’s MSDN article on Programming with WSE2. I know – it’s been around since July…six plus months, but hey, I’m an “early-ish” adopter, not an instant adopter. Also of course the reference docs. Here’s a list of MSDN articles.

Having delved into WSE1 makes this all seem so sensible. Like Policy configuration files. Neat. Rather than writing all of that glob in the webservice code and in my client side code, I create a config file (that can be used over and over and over again if I like) that defines what the requirements are before a message can be processed and their are policies for sending and receiving. So this goes way beyond just encrypting a message and tightens down your processes like crazy. Here are some of the things that you can test for before you even decide to BOTHER with the message. You can demand that it be signed with a particular type of digital signature. You can say that you will only look at messages that are *fully* encrypted rather than messages that only have certain portions encrypted. Thihgs like that. So you could conceivably create a policy that will apply to all web services used in all of your applications. Makes sense.You may already have those policies on paper, but then have to implement them in gobs of code. Now you can take those paper policies and write them into a policy configuration file.

Now I still have to work out how all of the rest of the stuff happens. And I am cross-eyed and Rich is getting ready to go ski in the woods and I am NOT missing out on that happy and hard-earned event.