Thursday, 4 December 2008

SQLExpress and Compressed Files

Another of those things I'm blogging for future reference...

A little while ago I ran the Windows Disk Cleanup utility to recover some space on my hard drive. One of the things it did was go through my filesystem and compress files that I hadn't used in a little while.

I went back to some of those files yesterday - a WinForms project that I started ages ago that uses a SQL Express database - but when I tried to run the project I got strange errors in my DAL. I fired up SQL Management Studio and attached to my SQL Express instance, where things got even stranger. I had two databases showing, one with the path to my database and one with just the name of the database, but no plus sign next to them to expand them. Couldn't detach them, couldn't delete them. I did a bit of Googling and I saw a comment that SQL Express doesn't work with compressed files. Almost instantly I figured out what had happened - I uncompressed all the files in the folder and everything started behaving itself again.

Tuesday, 2 December 2008

Removing Items From the OutputCache

Today's learning point from StackOverflow:

Whilst it's clear that using output caching is a Good Thing, it can be a little counter-productive sometimes if a user changes some detail that invalidates the cached version of the page e.g. changing the price of a product, adding a new comment to a blog post. But as I've now discovered you can programmatically remove the cached version of the page by calling this static method on the Response stream:
Call HttpResponse.RemoveOutputCacheItem(myCachedUrl)

Looking it up on MSDN I discovered that this method has been present since .NET 1.1 and I've never come across it before!

Sunday, 23 November 2008

DDD7 - ASP.NET Scalability

I'd like to thank the organisers and attendees for giving me the opportunity to present 'This One Goes Up To 11, or How To Write Scalable ASP.NET' yesterday at DDD7 at Microsoft in Reading. It was my first time presenting at DDD, and I really enjoyed it. My session seemed to go quite well, there were a couple of demos I need to go through again to figure out why they didn't work, but overall I felt it was quite well received. All the sessions were videoed for Channel 9 , which is both quite exciting and means I'll get to see the sessions I couldn't get into :-)

A session I did get into was Phil and Dave's ASP.NET 4.0 runthrough. A lot of things are still under wraps, but one of the most useful things they demoed was the ability to set a control's ID and not have it munged with the control's container name when the html hits the browser. Which is nice. I feel validated in being unsure about MVC now I've heard that Phil's not keen on. It'll be interesting to see the new provider-based caching model when it arrives, especially as this will fit really well with Velocity. I'm not, however, at all sure about the new WPF-based Studio.

Edit: My slides and code samples are now available at www.philippursglove.com/ScalableASPNET.

Wednesday, 5 November 2008

Goodbye Windows 3.1

In amongst all the Presidential news going on today, this headline caught my eye: Closing Windows. Microsoft are ceasing to sell licences for Windows 3.1/11, the operating system I cut my teeth on (which probably dates me hugely although probably not as much as my recollections of loading programs off tape on my Commodore 64 - ah happy days).

I did my first professional coding on Win3.11 in 1997, using VB4.0 (ugh) for the client and Access 2.0 for the database (double ugh). Fortunately I didn't keep a copy of the code, although I think about reworking it occasionally as a web app with all I've learned since then.

I confess I had no idea MS still sold licenses for it as an embedded OS, though I guess it makes sense as a solid OS and if you have no need for a display etc it probably worked quite well.

Monday, 3 November 2008

Velocity CTP2

CTP2 of Velocity was announced at PDC last week - the announcement on the Velocity blog is here, you can download the bits here.

First thoughts are that they've done a lot of work since CTP1.

I installed this CTP tonight and ran up a super-quick demo, and it worked perfectly first time. And by perfectly I mean once I'd fixed my code. And by first time, I mean once I'd updated my web.config. This is good as it means all the problems were on my end, not theirs! (Same old story)

I'm going to have a bit more of a play today/tomorrow and will post some more details then. I've also got the PDC videos to watch.

Friday, 10 October 2008

How to Write Scalable ASP.NET

Like Barry, I got my email last night to tell me my talk on writing ASP.NET that scales sensibly (or indeed at all given the standard of code I've been reworking for the last two weeks) has been selected for inclusion at DDD7.

Suddenly I'm rather nervous and wondering if I can actually pull this off...

Thursday, 2 October 2008

.webinfo Files

Just one of those things I'm blogging so I can look it up when it happens again...

I converted one of our Web Application projects the other day from Visual Studio 2005 to Visual Studio 2008. It all built on my machine without any problem, but when one of my colleagues opened the updated project in 2008 on his machine it opened as a Website.

Eventually I compared folders between my machine and his, and I spotted a ProjectName.vbproj.webinfo file. I had a quick look at it in Notepad, the contents all looked correct but I had a sneaking suspicion that this was the culprit. I moved the file up a folder, and then re-opened the project in VS, just to see what happened. And it opened as a Web Application.