Monday, August 20, 2007
NNUGMost of us are back from vacation and so are Norwegain .Net User Group in Bergen. Check out the agenda and register for the August meeting here: http://www.nnug.no/Avdelinger/Bergen/Moter/Brukergruppemote-August/

If you’re not a member of NNUG, go here to register: http://www.nnug.no/Profil/RegistrerDeg/

While I'm on it, you should check out the agenda for upcoming MSDN Live as well: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032343418&Culture=nb-NO

and if your a student or new to asp.net you should check this out the introduction to asp.net development.



Events | NNUG
Monday, August 20, 2007 11:33:26 PM (W. Europe Daylight Time, UTC+02:00)

altiris.gifI've been using both Install Shield and Wise (Wise Installation Studio) for some time now and have mixed experience with both, but one thing puzzles me about Wise; there's no support for Application Pools! The IIS dialog in Wise only has support for IIS 5 features. I just can't fathom how they can keep releasing new versions of Wise without supporting IIS 6/7. Are no one using Wise for deploying web apps, web services etc? Are Install Shield the only choice for (advanced) plain Msi's?

Back in December 2006 I requested this feature from Wise on their forum and I got this answer:

“I've run it past the product manager, and there is no specific timescale for adding application pool support. I know it's come up once or twice before, but I think the overall demand is not significant enough to priorities this feature ahead of others.”

On their website they list key features and one of them is:

“Supports the latest technologies, including virtual applications and Microsoft Windows Vista.”

Fantastic! But no app pools! Later someone else requested this feature on my thread and Wise finally added a link where you can subscribe to this feature request. The more subscribers, the more attention it gets. Want to help me Wise out? Visit: https://kb.altiris.com/display/1n/articleDirect/index.asp?aid=3066&r=0.7956964 and click subscribe/unsubscribe on the right side, and hopefully this feature request will get Altiris Symantec's attention.
Monday, August 20, 2007 10:32:22 PM (W. Europe Daylight Time, UTC+02:00)
 Sunday, August 19, 2007
If you are like me you probably have a hard time finding something to create when trying out new stuff.  This time I sat down and tried to figure out something to use LINQ and Silverlight for and maybe WCF, WPF and Ajax as well. At the time I was watching TV and the EPG (Electronic Programming Guide) didn’t work, so I started to look for a web site with a program guide supporting reminders and other nice features to let you know what’s on TV. I didn’t find anything good.
I then started to look for an xml/text format for TV programs. I did some searching and came across xmltv. Nice! I now had an xml source looking something like this:

<tv>
  <channel id="channel1">    
    <
display-name lang="nb">Channel 1</display-name>
  </channel>
  <channel id="channel2">
    <display-name lang="en">Channel 2</display-name>
  </channel>
  ...
  <programme start="20070801033000 +0200" stop="20070801053000 +0200" channel="channel1">
    <title lang="nb">Program 1</title>
    <desc lang="nb">Program description.</desc>
    <credits>
      <director>...</director>
      <actor>...</actor>
      <actor>...</actor>
    </credits>
    <date>2004</date>
    <category lang="en">movie</category>
    <category lang="en">drama</category>
  </programme>
  ...
</tv>

So now I had an xml document containing all the data I needed and this was a perfect time to try out XLINQ. I decided to stick with the LINQ query syntax and not mix in Lambda expressions to keep things simple and readable. I came up with this expression to get all TV channels:
public List<TvChannel> GetTvChannelsWithoutGuide()
{
IEnumerable<TvChannel> channels; try
{ XElement tvGuide = XElement.Load(_xmlFileLoc);

channels = from c in tvGuide.Descendants("channel")
orderby (string)c.Element("display-name") ascending
select new TvChannel
{
Id = (string)c.Attribute("id"),
Name = (string)c.Element("display-name"),
Lang = (string)c.Element("display-name").Attribute("lang"),
TvGuideLoaded = false
};
} catch (FileNotFoundException fileNotFoundEx) { throw new FileNotFoundException(string.Format("Xml file for tv guide not found at {0}",
_xmlFileLoc), fileNotFoundEx); } return channels.ToList<TvChannel>(); }

The XElement gives me the complete xml document that I can use XLINQ expressions on. In my query I’m looking only for TV channels, so I specify that in the query by

    from c in tvGuide.Descendants("channel")

This gives my a variable c that I use in my orderby clause and select statement. The orderby clause

    orderby (string)c.Element("display-name") ascending


uses the c variable to access the “display-name” element to set order by. But it’s the select statement which is the cool thing here! First here a listing of the TvChannel class:
[Serializable]
public class TvChannel {
public string Id { get; set; } public string Name { get; set; } public string Lang { get; set; }

[XmlIgnore]
public IEnumerable<TvProgramme> TvGuideNonSerializable { get { return TvGuide; } set { TvGuide = value.ToList(); } }

public List<TvProgramme> TvGuide
{ get; set; } public bool TvGuideLoaded { get; set; } } 
Ignore the TvGuideNonSerializable property for now. By using select new TvChannel I can create an object of my TvChannel class an assign data from the xml document to my properties. I just love this syntax! It’s really nice and easally understandable. Another cool feature (running VS 2008 Beta 2) is that you get ItelliSense in LINQ for your classes, like this:

LinqIntellisence.png

I also created other methods for retrieving all programs for one channel, all channels etc. At the time of writing I’m working on a Silverlight implementation for the TvGuide which I hopefully can show you soon. And later I’ll make all source code available.

.Net | CSharp | Linq | TvGuide | VisualStudio
Sunday, August 19, 2007 1:11:51 PM (W. Europe Daylight Time, UTC+02:00)
 Tuesday, August 14, 2007
TheDotNetShow.jpgJust saw that there was a new episode (Silverlight) of The .Net Show out, and it started with telling us that this is the last episode! I've been watching this show on and off since its startup in December 1999! The show has been running for almost 8 years which makes this the longest running series at Microsoft. However, all good things have to come to an end. But it’s sad. I’ve really enjoyed this show and for a time (before blogging and rss) it was one of my few sources to new .Net technology inside the walls of Microsoft. Robert Hess’s (the host) last words in the show were:
Well, until next time, we'll see you on the Web and I might recommend you check out channel9.msdn.com. You never know who you might see show up there.
So I guess this isn’t the last time we see Robert. Thanks for all your hard work on this show during the years, giving us the latest news and insight into .Net technology! Salute!

Tuesday, August 14, 2007 10:55:54 AM (W. Europe Daylight Time, UTC+02:00)
 Saturday, August 11, 2007
InstallingUpdates.pngI just installed a new VM with Visual Studio 2008 and ran the Windows update to have a fully updated OS. There were 82 updates to download! About time to ship service pack 3? According to Mary Jo Foley, Microsoft have made a pre-beta available for testing and Microsoft says:
“We’re currently planning to deliver SP3 for Windows XP in the first half of CY2008. This date is preliminary, and we don’t have any more details to share at this time.”

Until then I'll rather wait for the download to finish than waiting for Service Pack 3 <smile>

Saturday, August 11, 2007 2:09:44 AM (W. Europe Daylight Time, UTC+02:00)
Christian Weyer has an article on MSDN Mag together with Steve Maine and Dominick Baier about using Windows Process Activation Service (WAS) for non http protocols. Actually it's about much more than that, but that is what I found interesting. Hosting WCF services in WAS gives you the possibility to use NetTcp, Named Pipes and MSMQ protocols. For more info about WAS you should read the article. Anyway, using WAS as a host for WCF services sounds like a good idea. You don't have to create and maintain your own NT Service and you get stuff like "on-demand activation, process health monitoring, enterprise-class manageability and rapid failure protection" for free. But then you also get some lifetime management "features":

"...WAS does demand activation (as you know, the "A" in "WAS" stands for activation). This means that the application domain hosting a service only gets created when a request message comes in. Application domains shut down again after a configurable idle period. There are also several reasons why WAS or the ASP.NET runtime may decide to recycle the application domain or even the whole worker process."
So I suspect there would be some overhead of creating and shutting down the app domain, unless you can set the idle period to infinite of course. And then you have the recycle bit... Hmmm.... Do I want that?

If I were asked: "WAS or NT Service?", I think I'll go for the NT Service, unless there's something I totally missed out on here... which definitely could be the case <smile>.

If you want to try this out you might find these code samples interesting in addition to the article mentioned.
.Net | IIS | WCF
Saturday, August 11, 2007 1:46:31 AM (W. Europe Daylight Time, UTC+02:00)