The views expressed on this weblog are mine alone and do not necessarily reflect the views of my employer.
 Wednesday, February 19, 2003
"Attaching a CacheDependancy to a ASP.NET Page using Output Caching" or "I can't believe they didn't think of this...oh sweet, they did!"

ASP.NET caching This seems like an obvious thing to want to do, but I can't see how. I have a bunch of pages using OutputCaching, like <%@ OutputCache Duration="600" VaryByParam="none" %> but the pages use additional data points / files that I'd like to add as additional cache dependencies. I can create the extra CacheDependency objects, but can't see how to connect them up to the cache entry for the page. I can't beleive the ASP.NET guys didn't think of this.[Simon Fell]

Simon is looking to add a CacheDependancy to a ASP.NET Page using Output Caching, he'll need to use HttpResponse.AddCacheItemDependency and HttpResponse.AddCacheItemDependencies

The most interesting thing about what Simon says is "I can't believe the ASP.NET guys didn't think of this."  That's funny, because I know as well as anyone that the Microsoft guys aren't perfect, but when it comes to the .NET Framework, I'll tend to search just a little harder on the faith that what I need HAS to be there...because they must have thought about this.  As you spend time with the .NET Framework you'll increasingly get that same attitude; they really did think this thing through.


Updated Link to this post 11:21:10 PM  #    comment []  trackback []
Undocumented configuration setting for XmlSerializer - and a new question emerges?

Doug Purdy inspired the crowd just to test (if there were such a possible setting) what would happen if you do this here in an application which uses XmlSerializer.
Very cool! If you do not want to try it out by yourself then I would recommend to download this little
test program ;-)
[Christian Weyer]

Now that's COOL.  Nice to get that insight into what's going on inside the XmlSerializer. 

<sidenote>Recognize that filenaming style?  "qhtozc7m.0.cs" and "qhtozc7m.cmdline"?  You may have seen it in c:/WINDOWS/Microsoft.NET/Framework/v1.0.3705/Temporary ASP.NET Files.  (If you haven't, go look!</sidenote>

So, now my question to the people is, what .NET Framework subsystem is managing all those temporary files, lifetime, naming, launching csc.exe, etc, for this kind of compilation? CodeDOM? Don't think so...


Updated Link to this post 4:09:46 PM  #    comment []  trackback []
Kent Sharkey in the heezy fo' sheezy babay!

Kent Sharkey in the heezy! RSS Subscribed. 

And you know he's a nice guy since his Googlisms are:

kent sharkey is an mcsd
kent sharkey is the soap evangelist and is learning a fear of my camera and me
kent sharkey is the technical evangelist

 


Updated Link to this post 3:58:29 PM  #    comment []  trackback []
Snazzy tool to the rescue: TaskManagerEx (The

In an attempt to find a quickie utility to force open files to close under Windows I stumbled upon TaskManagerEx that extends the Windows Task Manager with such yummy features as:

  • Use different color for services
  • Find a used file by any process. (Use * as file name for showing every used file)
  • Find a used module by any process
  • Use different color for processes if the CPU usage reaches a given limit ( 25%, 50%, 75% )
  • Query list of every files, handles, modules, windows used by a given process
  • Close a used file (you can unlock an exclusively opened file, so you can delete it)
  • Unload a used module (so you can delete it)
  • You can kill services too
  • Fast end process. Press DEL key!

    Needless to say, this baby goes in Startup and C:/UTILS!


  • Updated Link to this post 3:40:23 PM  #    comment []  trackback []
    Sairama's Interesting Code of the Day - Printing Line Numbers while Debugging C#

    In C++ if problems happen, we'll want to log the error along with filename and Line Numbers, often like:

    CString strCompleteMessage;
    strCompleteMessage.Format(_T("%s , HRESULT %0x [%s,%d]"),strMessage,hr,A2W(__FILE__),__LINE__);
    LogInfo(strCompleteMessage);

    In C#, there are no such macros so we use the StackFrame class. Below we show how to print the filename and line numbers while logging messages/errors.

         public static void foo()
         {
         // some operations here
         // some error here
         string msg = "Unable to do xyz operation, Please report this to abc@xyz.com";

         // true means get the file information also ( needs pdb files which can be generated for Release builds )

         StackFrame CallStack = new StackFrame(0, true);
         Console.WriteLine("Error:{0} occurred in:{1} in File: {2} at Line: {3}", msg, CallStack.GetMethod(), CallStack.GetFileName(), CallStack.GetFileLineNumber() );
    }


    Updated Link to this post 2:33:23 PM  #    comment []  trackback []
    Microsoft aquires Connectix - VMWare screwed?

    update Microsoft is acquiring some assets of Connectix, including an unreleased server program and software that permits Windows to run on a Macintosh. [News.com]

    Interesting, since Microsoft has a universal license for VMWare for all MS employees.  I've never used the Connectix product, but I guess I will soon!


    Updated Link to this post 2:26:37 PM  #    comment []  trackback []
    Outlook2RSS v0.4 with support for Images

    Jorge Curioso and I have updated Outlook2RSS (download here) (modified from Peter Drayton's Google2RSS) to include additional features in RSS 0.93 as well as support for Inline Images and Attachments from within Outlook!  This means, you can include inline images from within Outlook and with a little magic (very little) we will deal with all the Outlook cid://ABCE32432 crazy URLs and munge the content appropriately.  The images will be extracted from Outlook into the same directory as the RSS feed with the external URLs automatically added.

    Jorge is happily running his blog with Outlook2RSS and has added a "Publish Blog" tool to his standard Outlook Toolbar.  You too can have you own blog from Outlook...just create RSS from a private or public Outlook folder and style to taste.

    Next step, make it an add-in...here's a thought - Greg, how about using this code to implement an "Export to RSS" feature in NewsGator so we can both aggregate feeds and publish feeds from any Outlook Folder?  You've got all the infrastructure already...I'd like to have it run on the same schedule, and it'd only be one extra tab...;)


    Updated Link to this post 12:27:12 AM  #    comment []  trackback []