Saturday, November 13, 2004

Two of the new classes inside of System.NET.Cache are the HTTPRequestCachePolicy and RequestCachePolicy. It gives us some control on client side caching on a request by request basis. Since I think "web apps" when I think about caching, it took me some time to grok (with some help from a few folks at MS) what it's real purpose is.

Of course, it doesn't make sense that a webserver based app would have ultimate control over client side caching (wouldn't that be cool though - magic, but cool!) As far as I know, only the client machine has knowledge of what is in its' cache.

These classes are available for client and middle tier applications that are making HTTPWebRequests or FTPWebRequests and allow you to control how a webrequest is handled based on either the age of what is available in the cache or just by the location.

Since I do most of my interaction with a webserver via web services* or aspx pages, this doesn't solve any problems that I am currently having, but it has given me some ideas of how I might leverage it in my applications.

Here are some ideas.

Say you have a web application that creates a pdf report and returns it to the calling client - maybe that is a windows app or even a web app that is the client. The data for this report does not change very much during the course of the day and it is a huge report. So you don't realy want users taxing the webserver by requesting it more than once per day. You can tell the calling application to first check the local cache and if that download is in there and it is less than one day old, then it will not bother making the request.

Another example is for windows apps that actually use the web browser control. I have never had occasion to do this myself. But you can control how calls are made to the webserver to populate that control with instructions similar to the above sample - based on age or freshness - or you can instruct it to always go from the local cache under certain situations or always from the server. Or you can tell it that if there is nothing in the cache than get it from the server, but otherwise always get it from the cache. My simple demo on this only showed interaction with this funcationality. I had a web page that displayed the current time and you could see, for example, the time not changing for 5 seconds even though I was doing rapid-fire refreshes on the page.

This is not earth shattering functionality for the work that I do, but I can imagine that people writing applications for large corporations would benefit greatly from every tool that reduces the toll on the webserver. You can read more in this online documentation for .NET 2.0: Cache Management for Network Applications.

*re: web services - I REALLY wanted this to work with web services, but it just doesn't. Although you can pass it the uri of an asmx file, there is no way to call the web method. I tried setting up the definition of the policy against the entire web service and then making a call to the webmethod, but it just didn't work.

Posted from BLInk!

Saturday, November 13, 2004 2:25:53 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Thursday, November 04, 2004

Although I was expecting some syntax changes, so far, my debugger visualizer that I wrote with the March bits and ran with the Beta1 still runs in the October bits.

Two things to note: if you have the debugger visualizer project open in the same solution as the app you want to use it in, you will get a wierd error when trying to use that visualizer in run time. I actually haven't dug into how to debug these things. They are not like a project that you reference and debug into. But if you are testing it, you would just open it up in a separate instance of VS, then compile and copy the dll into the directory and test again.

The other thing is that when you create your visualizer and, as per the Beta1 bits, have to put them into mydocuments\visual studio\visualizers folder. In these bits, the folder does not pre-exist. However if you use one of the canned visualizers, then the folder gets created automatically.

Here is another pointer if you are moving a d.v. from older bits to newer bits.



Posted from BLInk!
Thursday, November 04, 2004 2:19:24 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Wednesday, November 03, 2004
Wednesday, November 03, 2004 3:02:13 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
Just for fun, I'm going to put the latest CTP of Visual Studio on my laptop that I will be using for my What's New in BCL Whidbey for ASP.NET developers presentation at next week's ASPConnections. Maybe I'll even try to run SQL 2000 Developer Ed. and sql 2005 express side by side. Just have to watch out for that sqldmo problem (though maybe it's fixed now) 

Posted from BLInk!
Wednesday, November 03, 2004 12:44:55 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Tuesday, November 02, 2004

Geeze since March! Subscribed. Their second post is about what I need to do: dynamically embed an image into a report at runtime. Of course, it's on www.ASPADVICE.com!



Posted from BLInk!
Tuesday, November 02, 2004 9:08:10 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

You probably know that Crystal was bought by Business Objects last year. Crystal is a great product with a horrible support reputation. That's not about individual support people (I spoke with an awesome one last night) but just an overall problem. I have suffered plenty as well. I will never get past the experience of upgrading from 6.0 to 8.0 and how it horribly shattered many of my client applications and the deployment nightmares I went through (and my famous $500 phone bill for calling the free support line in Canada). And still, when I do have a problem, I sometimes cannot find the solution to it (granted at this point I have wierd problems, but still....)

But they are really trying. Now they have a .NET Developer Zone. It's still a work in progress, but the more we use it, the better it will get.

I know that we all want it to be a good resource. So use it and if you don't like it, let them know about it. Let them know what they can do to make it good so that we don't roll our eyes when talking about Crystal Reports.

This is the tool I have used for years and am still using it even though I do keep looking over at ActiveReports and SQL Reporting Services. The hook for me is I know how to use Crystal. I only run into trouble once in a while, but I just don't wnat to have to spend 4 hours researching a problem and still not come up with a solution.



Posted from BLInk!
Tuesday, November 02, 2004 8:48:00 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Monday, November 01, 2004

I have been trying to figure out why my crystal reports are mysteriously growing to 2+MB in one of my applications. Ummm DUH - I kind of forgot that I had embedded a watermark in them and that file is over 1MB. I actually got them to call me to help me about it (awesome tech support guy who has been with Crystal for 7 years). I think sometimes I am too quick to get aggravated by Crystal.

Now I have to figure out how to either shrink the watermark or I was told I can deploy the rpt files outside of the dlls.

Update: not so dopey. Even if I use a 30KB jpeg for the watermark, it still get's morphed into an OLE bitmap and makes a 400KB dll with a crystal report in it go to 2MB. It's just how it works.

Posted from BLInk!
Monday, November 01, 2004 6:19:25 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I have always had problems writing cd's. This is with 2 different cdr's and lots of different software over the course of many many years. I would have to toss about 2 cd's for everyone written. So I basically avoid it like the plague. But I just downloaded an ISO image and discovered that Windows XP has built in software and I don't have to struggle any more. I just dragged and dropped the file to the cd in windows explorer and xp handled the rest. Finally. Thanks to whomever put that in there.

Of course I still have to test that it worked...

Okay I confess. I literally copied the ISO so I had to toss 2 cd's after all. Then read the in your face ISO instructions and downloaded ISO Recorder (note there's an XP and a new XPSP2 Beta version) and also note this is shareware. If you use it enough to justify thanking the creator, click on that PayPal button. This makes it pain free - right click on the ISO file and you're almost done. Thanks Alex!!



Posted from BLInk!
Monday, November 01, 2004 2:29:26 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Friday, October 29, 2004
KVM stands for Keyboard Video Mouse. Since I bought a new desktop this summer, my former daily driver was sitting in a corner doing nothing. I just bought a KVM 2 Port Switch made by LinkSys that is one sweet little cable with all of the connections built in. I can now switch between that computer and my regular one without moving any more muscles than my little index finger to tap on the Scroll Key twice. Love it! Now all I need is Ghost so that I can use that machine either to test additional beta software or to emulate a clean client machine to test installations, etc.

Posted from BLInk!
Friday, October 29, 2004 8:56:17 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Wednesday, October 27, 2004

Cool!! This might finally enable me to rip that Access database out of one last of my old VB6 projects.

It also made me wonder why I haven't even played with this stuff yet and then I realized I've kept myself busy with WSE2, ADO.NET2 and a host of other new things. Oh, to be able to just spend all of my time playing with the new toys and call it a job. Yeah I know some people actually have that as their job definition.



Posted from BLInk!
Wednesday, October 27, 2004 3:52:20 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  |