Friday, April 18, 2008

tfsbox Today I had a problem. At work we had a SCSI Raid controller that failed and we lost a logical device. Man I was pissed off! On top of this the raid was RAID 0 (striped), meaning there was no chance of getting any data back. This was the drive(s) hosting the OS which we had to reinstall :-( Anyway, this resulted in me having to spend quite some time in a freezing and noisy server room fixing the problems. While doing stuff like this (reinstalling OS, software and a pointless effort of restoring data) there is a bit of waiting time, so I figured I might as well work on our new server waiting to get TFS 2008 up and running. A brand new server (see spec below) dedicated to protect the heart of our company; the source code!

So I started digging around for the TFS 2008 DVD, knowing it should be on my desk with the MSDN subscription we get through the Microsoft Gold Partner program, but it was nowhere to be found. After a call to MSDN it turns out that the DVD's are now being shipped to our headquarters in Oslo, which was the case for TFS 2008 as well, but they couldn't find it. The guy who knew was of course away that day. You might wonder why not download? Well, you can't. TFS versions available on MSDN subscription is only Workgroup and trial editions.

My last attempt before giving the whole thing up was calling my friend John from NNUG and ask if they had a DVD I could use. He had a much better idea:

"Just use the trial and upgrade with your key at a later time".

Dooh! Why didn't I think of that. Check out Brian Harry's blog for more details: http://blogs.msdn.com/bharry/archive/2007/11/22/2008-installation-questions.aspx

Server spec:

  • HP ProLiant DL380 G5 Intel® Xeon® E5440 Quad Core Processor 2.83 GHz 12MB 2GB 1P Rack Server
  • HP 4 GB PC2 5300 DDR2 DIMM Memory
  • 6 HP 72GB 2.5 inch 15K rpm Hot Plug DP SAS Hard Drives
  • 2 HP 146GB 2.5 inch 10K rpm Hot Plug DP SAS Hard Drives

hpserver 

I think this should keep our source code safe for a while...

Friday, April 18, 2008 9:56:18 PM (W. Europe Daylight Time, UTC+02:00)
 Friday, April 11, 2008

The first .Net user group ever (as far as I could find out) was started by Ruth Walther in Seattle December 2000. It seams like this group is no longer active and I was unable to find out why. Anyway, today you'll find a user group in almost every major city in any country. And if you don't have a user group where you live, I think it's about time you start one! :-) Seriously, it's not that hard and you'll be a hero where you live! :-)  I can really recommend the experience and people will defiantly appreciate someone taking the first step to get your city on the user group map.

NNUG2After the first user group started up in the US many others soon followed during 2001. To pick a few other countries I'm familiar with I can say that my home country Norway started their first user group in Oslo October 2001 and in my city Bergen we started up in December 2002, the London .Net User Group was started in 2002 and Sydney Australia in April 2002, .

It's free
HangingDollars Most user groups I know of don't charge for membership. Many don't even have memberships, but use the word of the people to announce their meeting or that "everybody" knows that their having a meeting last Wednesday in every month, and it's just to show up. User groups rely on local, national and/or international sponsorship. If your country have a Microsoft company present, they usually help out. This can be to help you get in touch with speakers, sponsor travel costs (for speakers), pizza and the like. The user group I run in Bergen use local sponsors for pizza, but get some help from Microsoft for travel costs. When requesting speakers it's often smart to provide them with consulting when they visit your city. This is a nice way of helping your local companies get excellent consulting and it make the speakers trip to your city a bit more attractive.

Why are user groups so popular?
There are many reasons for this and they vary from user group to user group. But from my experience there are some general things that should more or less apply to all user groups:

  • It's free
  • You get free food (usually pizza)
  • You get to meet other people from other companies to share experience with, that you would usually not meet outside the user group
  • You learn a lot
  • Keeps you up to date on what's going on
  • Communities in general are popular

INETA
Ineta INETA is the mother organization for all .Net user groups. Its an acronym short for International .NET Association. You will find user group related to SQL server, VB, SharePoint and other .Net related products. They all have in common that they focus on some type of Microsoft .Net related technology. INETA is divided into five geographical areas; North America, Latin America, Middle East and Africa, Asia Pacific and Europe. My experience is with INETA Europe, but I expect it to work much the same in the rest of the world. INETA Europe have among other things a Speaker Bureau with lots of good speakers. As a member your user group can request two speakers per year. These are top notch speakers! In Europe you'll see names like Ingo Rammer, Christian Weyer, Dino Esposito to mention a few. As a member your user group will also get a quarterly kit where you can select some books, cd's and other stuff to use as giveaways for you members, prizes etc. INETA also helps getting user groups started, especially if it's the first user group in the country. If there are existing groups in the country, the other groups usually helps you getting started in your city. That's how communities work!

.Net | Microsoft | NNUG
Friday, April 11, 2008 4:03:52 PM (W. Europe Daylight Time, UTC+02:00)
 Thursday, March 13, 2008

MouseClickServer deployment of ClickOnce? Isn't ClickOnce client deployment? Yes, it is. However, you will have to deploy the ClickOnce files to a server, right? I feel this is a poorly documented step and I thought I share some of my experience around this.

So what's the problem? The main issue is the deployment manifest file. If you've worked with ClickOnce you know about this file, if not here's a (very) short description. The deployment manifest includes information about where the ClickOnce application is located (e.g. http://myServer/myWD/myApp.application) as showed in the following snippet:

...
<
deployment install="true" mapFileExtensions="true" trustURLParameters="true"> <subscription> <update> <beforeApplicationStartup /> </update> </subscription> <deploymentProvider codebase="http://myServer/myWD/myApp.application" /> </deployment>
...

This file needs to be signed with a certificate to be valid, which means that any changes to this file makes it invalid and you'll have to resign it. This is a good thing for security, but it causes some problems regarding deployment. The url specified in this file must be changed when deployed at a server. Unless you want to get all information needed from your customer and create the deployment package before sending it to them or force them to set up a server named myServer ;-). I don't think that solution is very likely to be used in production systems. So what you need to do, is make the installation (e.g. msi) change the manifest file and resign it during installation.

Microsoft has provided us with a tool to do exactly this. However, you're not allowed to redistribute it. Another issue is that you need to have a certificate for signing and you don't want to have your corporate certificate laying around in your msi. The most common solution around this problem is to prompt the user during installation for a certificate (like suggested here). But then your app is signed by someone else's certificate, which is probably not what you want.

I will now suggest a different solution to this problem. In the System.Build.Tasks.dll you'll find much of the functionality needed to do the same thing as Microsoft's Mage.exe is doing. The nice thing about this dll is that it's a part of the default .Net Framework installation. Here's a short description of the classes needed:

DeployManifest
An object model for the manifest file. Gives you direct access to specific parts of the manifest and makes it really easy to make changes.

ManifestReader
Have a static method (ReadManifest) which let you read and return the manifest you are going to work with.

ManifestWriter
Use the static method WriteManifest to write your changes back to the manifest file.

X509Certificate2
Your certificate to sign the manifest file with.

SecurityUtiities
Has the static method called SignFile which let you sign your manifest.

By using the classes described above it should be quite easy to achieve the same as with the Microsoft utility. Here's an example:

using System;
using System.IO;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Build.Tasks.Deployment.ManifestUtilities;
...
string
manifestPath = @"C:\Temp\myApp.application"; string deploymentUrl = "http://myServer/myWD/myApp.application"; DeployManifest manifest = (DeployManifest)ManifestReader.ReadManifest("DeployManifest", manifestPath, false); manifest.DeploymentUrl = deploymentUrl; ManifestWriter.WriteManifest(manifest); X509Certificate2 certificate = new X509Certificate2(GetCertificateFile(), "password"); SecurityUtilities.SignFile(certificate, null, manifestPath);

There is one important step we need to solve. How do we protect the certificate we need to sign the manifest file. For this I suggest you incorporate this into your tool (either a command line tool or a .Net library) by using Build Action = Embedded Resource. This will make your certificate inaccessible for most people. If you want to secure it even more, you can crypt it in however way you want. I leave this up to you ;-) In my code above I've done this in the GetcertificateFile() method:

X509Certificate2 certificate = new X509Certificate2(GetCertificateFile(), "password");

There is of course one other issue which you'll have to consider. What if someone uses your custom tool to sign their ClickOnce app? So you need to protect this as well with a password or some other mechanism. If you have a good suggestion to this, please let me know.

Thursday, March 13, 2008 3:03:15 PM (W. Europe Standard Time, UTC+01:00)
 Thursday, February 21, 2008

suits Before installing SP1 I could right click anywhere in Windows Explorer and select search to do searches in that folder. After SP1 it's gone! Why? Blame "us" (the Europeans or actually EU). They (I say they, because Norway is not part of EU :-) ) found a "new" game to play with MS. It's called Antitrust and it's about Suits meeting up in in European courts to talk about software. Browsers are especially popular, but sometimes they talk about other types of software as well. The looser of the Game (usually MS) have to become agile and change their software so the Europeans can get their price. This time MS didn't want to play, so they just gave the EU the price.

What's the price you might ask? A pluggable search architecture. If you are a provider of a desktop search engine, users can now set your search engine as default search in Windows. So what if I want to have the contextual search like it was? Then you can change a registry key as described here or just use Windows key + F as I do.

Thursday, February 21, 2008 8:43:14 AM (W. Europe Standard Time, UTC+01:00)
 Saturday, February 16, 2008

As mentioned on the Vista blog, Microsoft changed their mind regarding the release date of Vista. The original statement was that it would not be available until mid march (though it was already in RTM). You can now find the download at MSDN Subscriber Downloads. You'll will not find it in your normal subscriber download page, but on the front page where you have a list of Top Subscriber Downloads, like this:

VistaSP1OnMSDN 
I installed SP1 Friday night and it took it's time, but there were no problems. My first concern was if all my drivers would still work after installation, or if I had to reinstall some of them (as mentioned on the Vista blog). After initial boot everything was fine so no problems there.

The next morning however I went out for 30 minutes leaving my laptop on. When I came back it had restarted. I inspected the System log only to find this:

The previous system shutdown at 10:29:45 on 16.02.2008 was unexpected. 

Nice! In the Security log the only trace I could find of a shutdown was this:

Audit events have been dropped by the transport.  The real time backup file was corrupt due to improper shutdown.

I'm quite sure that this was not related to any external event (like power failure or the like). If it was, my laptop would still be turned off when I came back. I really hope this was a one time incident and that I don't have to worry about this in the future.

Saturday, February 16, 2008 11:19:12 AM (W. Europe Standard Time, UTC+01:00)
 Tuesday, February 12, 2008

ndc2008Logo If you want to attend the first ever Norwegian Developers Conference you should keep an eye on this site: http://www.ndc2008.no/ They will start to sell conference passes from 1st of March and I will definitely be in the virtual cue. Unofficial rumors say that a two day conference pass will cost around 3000 Norwegian kroner (about $500 or €380). B.t.w. I wonder what the url will be next year? ;) Hopefully they'll get the www.ndc.no domain by then. Looks like it's not used for anything else than sponsored links (that's why I'm not linking). Someone probably whispered that MS is involved in the conference and their dreaming of an insane price for the domain, which their probably going to get... yea right!

Events | Microsoft | NDC
Tuesday, February 12, 2008 9:49:08 PM (W. Europe Standard Time, UTC+01:00)
 Friday, February 08, 2008

Update: I've found a temporary solution. After inspecting which files was in our package I found a 3rd party component that we don't use anymore but still had a reference to. This was references by our business layer, which all our web services use, hence this dll was in every bin folder on every web service. Since the size of the file was quite big it was enough to get the installation down to a reasonable size and avoiding the described error message.

For a while now our msi file that contains the application server for our product has not been working. Not an msi that our customers have, but one we're about to ship in two weeks. I've had my hands full for a long time, but today I finally got around to check what was causing the problem. Here's a screen shot of the error I get:

MsiInstallError

After a quick Google search I found that this is related to a bug on Windows Server 2003 and Windows XP. Cause:

This problem occurs if the Windows Installer process has insufficient contiguous virtual memory to verify that the .msi package or the .msp package is correctly signed. 

Fantastic! I will not go and ask all our customers to install the hotfix on their servers. That's just to stupid. About now you're probably thinking something like "How big is their app-server really?" or "What product can get to big for an msi file?". I can tell you... The size of the msi is 576MB. No images, no database, just pure .Net dll's! And actually we're not alone. Visual Studio Service Pack 1 had the exact same problem! Go figure. And even better, there is no hotfix for this on Windows XP.

Have we been coding like mad men for a decade and producing tons of code? I wish (or maybe not) :) The answer is simpler than you might think. Our application server contains web services only. At the beginning of our project we took an architectural decision to have our web services separated in virtual directories (or projects in VS). This to be able to update parts of our application without affecting the whole system. This was part of a master plan around the smart client principle and would let us deploy small modules into our application which dynamically loads the new behavior. As it turns out we have almost never done this in production. The drawback of this is of course that you get many of the same dll's scattered around in many virtual directories. And when you have many web services (by web services I mean asmx files and not web methods, 43 to be exact), and each one is dependent on your business and data access layer (which is quite huge) and more, megabytes is piling up.

So what's the solution? Well, since we don't really use this as intended we can just merge our web services into one and we will be home free. Except you don't do that two weeks before deployment with acceptance testing coming up. So I have to think of something else. The only solution I can see now is to find some way of making the msi smaller, which at the current time I don't have the faintest idea of how to accomplish. I can use a setup launcher (exe) which will probably solve it, but that will not make our customers very happy. Hopefully I'll figure something out during the weekend, or maybe you have a solution?

Friday, February 08, 2008 10:37:08 PM (W. Europe Standard Time, UTC+01:00)
 Wednesday, February 06, 2008

Windows_Vista_logo.jpgVista Service Pack 1 is now finished. The Vista team announced on their blog that they now have released SP1 to manufacturing (RTM). They also say that:

"...we have made great progress in performance, reliability and compatibility."

and

"...copying or moving files around your PC, your home network or your corporate network should now be much faster -- up to 50% faster in some scenarios (according to our internal tests)."

This has annoyed me a lot on my HP:

"In addition, on many kinds of hardware, resuming a Windows Vista-based PC from sleep is faster on Service Pack 1."

So when and where can I download? It will be available trough Windows Update in mid March (and auto download in mid April if you have this enabled). So why not today? During beta testing some issues was found related to some device drivers "that did not follow our guidelines for driver installation". So the next month will be used to:

"...giving us time to work with some of our hardware partners to make adjustments to the installation process for the affected drivers." 

If  you don't want Vista to update itself to SP1 when it's available, check out my previous post on how to block the update.

Wednesday, February 06, 2008 7:44:46 AM (W. Europe Standard Time, UTC+01:00)
 Saturday, February 02, 2008
Mark 17th and 18th of July June (Programutvikling's event site mention both June and July, but June is the correct month) in your calendar. Microsoft Norway and Programutvikling has managed to attract some great names. Check this out: Scott Hanselman, Roy Osherove, David Chappell, Mats Torgersen, Rafael Lukawiecki and Mary Poppendieck! Is that a great line-up or what? I wonder if they got this idea from my Developer Conference in Bergen post? ;)

For now there's not much information out there, but you'll definitely hear more the coming months. Rune Grothaug's blog from the Microsoft DPE team is a great source for events in Norway. Programutvikling has the event on their site here.
Saturday, February 02, 2008 12:22:49 AM (W. Europe Standard Time, UTC+01:00)
 Sunday, December 23, 2007

iis7logoSP's are a necessity, but what I want to know is what have they done to improve IIS 7? Here's what the release notes for SP1 RC says:

IIS was included in some Windows Vista SKUs to enable web-based developers to write and test their applications. IIS in Windows Server 2008 is a significant server role which requires Internet-level scalability and performance requirements. The IIS7 components have gone through significant performance and reliability enhancements since Windows Vista originally shipped, in order to be a large-scale server component. These changes do not affect most Windows Vista users who do not even have the IIS7 components installed, however because Windows Vista and Windows Server are aligned, these changes are included in Windows Vista SP1.

You can find the "complete" change log here: http://technet2.microsoft.com/windowsvista/en/library/005f921e-f706-401e-abb5-eec42ea0a03e1033.mspx?mfr=true

So does this mean that there is a full UI and ftp support? The current IIS available in Vista is very limited by this. You can configure most of the stuff in config files (like I did with http redirect and logging bandwidth and referrers), but I would at least expect the features found in IIS 6 to be available from the UI in IIS 7. I've googled around to find some  more info, but nothing yet. I guess I'll have to install the RC to find out. Not sure if I want to risk it though...

IIS | Microsoft | Software | Vista | Windows
Sunday, December 23, 2007 12:59:30 AM (W. Europe Standard Time, UTC+01:00)

Windows Vista Logo Soon Windows Vista SP1 will be available for download. Or actually, it might even decide to automatically update itself, even though you specifically told it not to! However, not all of us want this to happen without our knowledge (or want to wait until some unexpected behaviors has been discovered), so Microsoft has release a service pack blocker. This blocker will also work for Windows XP and Windows Server 2003. The blocker only work for a set period of time. Mary Jo Foley has more details in her blog.

Sunday, December 23, 2007 12:02:52 AM (W. Europe Standard Time, UTC+01:00)
 Wednesday, November 21, 2007
VSOrcas.gifYou probably know allready, but Visual Studio 2008 is now available on MSDN Subscriptions for download. If you don't have an MSDN Subsription I'm afraid you'll have to wait until February 2008...

Wednesday, November 21, 2007 12:07:24 AM (W. Europe Standard Time, UTC+01: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)
 Thursday, July 12, 2007
Yes, it’s important to distinguish between the two. At the partner conference in Denver Kim Saunders (Senior Director, SQL Server Marketing) said that they launch SQL Server 2008 in February, but the actual release will be in Q2. And by launching they mean that they have all the marketing material and the final product information, but not the product.

As for Visual Studio and Windows Server I have not yet heard anything similar, so I'm still thinking 27th for these.
Thursday, July 12, 2007 4:10:11 PM (W. Europe Daylight Time, UTC+02:00)

I'm in Denver at Microsoft World Wide Partner Conference, and I find it strange. The conference itself is not strange, but it's strange for me. I'm a developer/architect and not a sales guy. I'm used to devcons where the primary purpose is not to interact with as many people as possible, but to get your hands on as much information as physically possible. Here it's a total different game. The sessions are just not the most important. Making connections and meeting up with people you've been matched with by the conferencing tool is!

The first day I was the only attendant from my company since our COO arrived later that day. Because of this I was supposed to set up some meetings with potential partners. I just have to admit that this is so not me! So this brings up the question; what am I doing here really?

When I first got the opportunity to attend this conference my first thought was that this was not for me, but when I looked at the agenda and started to read a bit more about the conference I changed my mind. This was really an opportunity to get a different view of Microsoft technology and set it in another perspective. I think most devcons focus on the how, but at the partner conference its more the why.

Another difference with this conference is that there are actually women here! We tech guys are not spoiled with having many women on our conferences and I think that is really bad. I notice right away that this conference has a different tune to it just because of the mixed gender.

To sum it up I (surprisingly) can recommend this conference for tech people as well because of the overview you’ll get of the technology, but be prepared and bring your social skills! And don’t expect 400 lectures...

Thursday, July 12, 2007 3:42:31 PM (W. Europe Daylight Time, UTC+02:00)
 Tuesday, July 10, 2007

Update: At TechEd Barcelona Microsoft announced today (2007-11-05) that Visual Studio 2008 and .Net Framework 3.5 will release in late November. See the official press release here: http://www.microsoft.com/presspass/press/2007/nov07/11-05TechEdDevelopersPR.mspx


I’m at the Microsoft Partner Conference in Devner where Microsoft just announced the release date for Visual Studio 2008, SQL Server 2008 and Windows Server 2008. Look forward to February 27!

Tuesday, July 10, 2007 9:11:44 PM (W. Europe Daylight Time, UTC+02:00)
 Monday, July 02, 2007
DestroyAllInvadersSmaller.jpgJust found a Silverlight game that uses Virtual Earth as a backdrop for a helicopter chasing alien invaders. Check out the game here: http://www.andybeaulieu.com/silverlight/DestroyAll/Default.html

Want to hack yourself? You'll find the source for the game here: http://www.andybeaulieu.com/Home/tabid/67/EntryID/75/Default.aspx

The game is created by Andy Beaulieu.

Monday, July 02, 2007 4:46:34 PM (W. Europe Daylight Time, UTC+02:00)
 Monday, June 04, 2007
Ripple2.jpgThis was just to cool to not blog about! Nothing much to say except that you have to check it out yourself. I have two links for you, one to the official Surface site at Microsoft and the other to PopularMechanics. The last link shows much of the same as the official site, but in a more “documentary” style :) If anyone gets hands-on experience with this, I would really like to hear from you on how it was.
Monday, June 04, 2007 7:52:56 PM (W. Europe Daylight Time, UTC+02:00)
 Monday, April 16, 2007
Silverlight.gifFirst thing I thought about when I heard about WPF/E was that it's Microsoft's answer to Flash. Nothing wrong with that, but now when I saw the official name I thought the exact same thing! Silverlight, Flash, silverlight, flash.... Hmmmm... Just another name for flash :) I wonder if this was what they meant. At least they didn't end up with Microsoft Windows Presentation Foundation for Extreme Internet Graphical User Interface (MWPFEIGUI) or something like that. Guess they saw the blog post over at Secret Geek. Anyway, I'm looking forward to do some real coding on Silverlight and for the record; here are the official Silverlight page.

Update: For more info about Silverlight, check out Mary Jo Foley's blog post.
Monday, April 16, 2007 2:46:53 PM (W. Europe Daylight Time, UTC+02:00)
 Sunday, April 15, 2007
According to Scott Hanselman, Microsoft has released an update to speed things up a bit. Here are some of the improvements:
  • Accelerate the download of messages from the Exchange e-mail server
  • Reduce temporary freezes resulting from deleting messages or copying them from one folder to another
  • Allow faster switching between messages
  • Enable faster program startup
Sunday, April 15, 2007 1:43:07 PM (W. Europe Daylight Time, UTC+02:00)
 Saturday, April 14, 2007
Just a reminder for MSDN Live in Bergen the 23rd of April. This time Microsoft have joined forces with Norwegian .Net User Group and me and John St. Clair are speaking at the last session of the day. I will talk about migration to WCF and John will do Debugging, Tracing, and Administration: Tips & Tricks. Here you'll find details about the "NNUG Agenda".

Events | Microsoft | NNUG | WCF
Saturday, April 14, 2007 11:39:30 AM (W. Europe Daylight Time, UTC+02:00)
 Wednesday, March 07, 2007
Jamie Cansdale over at TestDriven.NET had a rather strange experience with Microsoft lately. Check out what they sent him:
I’m contacting you to ask if you would like to be considered for an MVP Award in recognition of your contributions to technical communities over the past year.
And then:
Vicki Collins (Brook Street) would like to recall the message, "Microsoft Most Valuable Professional Award"
Check out the full story at his blog.

Wednesday, March 07, 2007 10:29:04 PM (W. Europe Standard Time, UTC+01:00)
 Wednesday, January 24, 2007
MSAjax.jpgIn case you missed it, MS AJAX 1.0 is now released. Now you can play for real :) Check out Scott Guthrie's blog for details. Or if you want to go strait for the download, you'll find it at ajax.asp.net.

Ajax | Microsoft | Web
Wednesday, January 24, 2007 10:50:31 PM (W. Europe Standard Time, UTC+01:00)
MsdnLive.jpgDon't forget to register for MSDN Live in Bergen 13. February! It's no surprise that Ajax and IIS 7 attract a lot of people to this event, so register now before it's full. You don't want to become the guy, who wasn't there, would you? ;) You can even pick up some Tips & Tricks for VS 2005. If this Tips & Tricks session is the same as at TechEd, you'll have to see it!
Wednesday, January 24, 2007 12:37:07 AM (W. Europe Standard Time, UTC+01:00)
 Monday, January 22, 2007
The guys at Microsoft Patterns & Practices have created a new site for upcoming releases. Nice to see what’s going on release wise. Take a look at Tom Hollanders blog to get the complete story.
Monday, January 22, 2007 3:15:26 PM (W. Europe Standard Time, UTC+01:00)
 Wednesday, January 10, 2007
Everyone who knows me knows that I have a special interest for memory leaks in .Net. At the company where I work we have solved a lot of these issues and I’ve also had talks about this at Norwegian .Net User Group (NNUG) in Bergen and Stavanger. One of our biggest problems was memory leaks related to events. Rico Mariani (MS performance guru) has set focus on this in his blog today by this blog post, so go check it out!

He focuses on the issue related to event generators, but there are other areas where you can get into trouble as well. I’ll try to explain our scenario:
  1. We have a graphical engine responsible for creating graphical components (user controls) dynamically by using reflection.
  2. All of these user controls inherit from the same class which exposes a lot of events.
  3. When our graphical engine creates new instances of these user controls it hooks up these events.
This model is created to have loose coupling between the user controls, the engine and other components we have in our app. The engine has a lot of knowledge about other components and services in our app, which sometimes our user controls wants to communicate with. This communication is done through these events. Here’s an example:
I have a user control that wants to tell a service that he have made some changes the service should know about. For this we have created a special event on the user control that the engine listens to. So I trigger this event on the user control, the engine receives it and tells the service about it.
com.png

These event hookups caused us a lot of pain at some point. Our solution was the first that Rico mentioned in his blog post (IDisposable), which I personally would prefer. In addition to this we added some reflection code which found events and removed them. You’ll find more info about this here: http://channel9vip.orcsweb.com/ShowPost.aspx?PostID=180985

Before I end I want to recommend two tools you can use to find memory leaks in .net. The first one which we use is called .Net Memory Profiler. The other one which I’ve not personally used but I’ve heard others are using is the ANTS Profiler. So go find your leaks. Happy hunting!
.Net | MemoryLeaks | Microsoft | NNUG | Work
Wednesday, January 10, 2007 1:02:22 AM (W. Europe Standard Time, UTC+01:00)
 Thursday, January 04, 2007
feed-icon-32x32.gif I was looking for some new rss feeds at MSDN and found this page : http://msdn2.microsoft.com/en-us/aboutmsdn/aa973533.aspx

This might have been here for ages for what I know, but I just found it. Just wanted to let you know in case you didn’t ;)
Thursday, January 04, 2007 2:38:03 PM (W. Europe Standard Time, UTC+01:00)