Home
About
Contact
Friday, January 16, 2009

InfoQLogo My article about The Future of Microsoft .NET Programming Languages just got published on InfoQ.This is my first attempt at being an editor for them, so if this works out I hope you will see more stuff from me in the near future.

Would love to hear what you think, so drop me a comment if you like.

Friday, January 16, 2009 2:56:53 PM (W. Europe Standard Time, UTC+01:00)
Saturday, December 20, 2008

A few years ago I did some presentations on memory leaks in .Net. I pointed out a few things you needed to be aware of even though you have a garbage collector. Like how you manage your events in .Net. Anyway, back then Rico Mariani was a great source for me (or actually his blog was)with all his knowledge about memory and performance stuff.

Summer 2007 Rico became Chief Architect of Visual Studio which gave me hope :-) I think we already start to see his impact on the product. If you have been following Rico’s blog you know that he has been working with performance for almost 30 years!

Anyway, on his blog he have a few articles about where VS 2010 is heading and what we can or cannot expect. He also talks about the overall plans for Visual Studio (and not only 2010) which I found to be interesting reading. Here’s a couple of links from his blog:

http://blogs.msdn.com/ricom/archive/2008/11/18/the-visual-studio-tech-roadmap-starring-visual-studio-2010.aspx

http://blogs.msdn.com/ricom/archive/2008/11/25/visual-studio-dialogue-with-wpf-performance-emphasis.aspx

One of the things that have come up is the use of WPF. WPF in Visual Studio? Is that a good idea? Well, as Rico says: Do you really think GDI is the last word in computer graphics for the next 10 years?

Check this video out where he more or less summarize what he said on his blog about VS: http://channel9.msdn.com/shows/Going+Deep/Rico-Mariani-Visual-Studio-Today-Tomorrow-and-Beyond/

Below is a couple of other interviews he have done lately:

http://channel9.msdn.com/posts/VisualStudio/Paramesh-Vaidyanathan-and-Rico-Mariani-The-Future-of-Visual-Studio-Extensibility/

http://deepfriedbytes.com/podcast/episode-21-talking-performance-with-performance-preacher-rico-mariani/

Saturday, December 20, 2008 11:31:31 PM (W. Europe Standard Time, UTC+01:00)
Sunday, October 26, 2008

This is my fifth post in my WiX and DTF series. Here are some others I’ve written:

After working quite a bit with Custom Actions (CA’s) in managed code I thought it was about time to show how we can debug CA’s. Before DTF it was almost impossible to step into your code written in C++, VB Script or Java Script and debug. With DTF this is simple, but still not 100% intuitive or straight forward. You have two options mentioned in the DTF documentation for debugging your code and a third which is not mentioned:

  1. Use environment variable MMsiBreak (not to be confused with MsiBreak)
  2. Attach the debugger to the process via a message box
  3. Use System.Diagnostics.Debugger.Launch

Using MMsiBreak

Here’s how to add MMsiBreak to your environment variables in Vista:

  1. Start –> Right click Computer –> Properties (or navigate to Control Panel –> System)
  2. Select Advanced system settings
  3. Click Environment Variables…
  4. In the System variables section click New…
  5. Set Variable name = MMsiBreak
  6. Set Variable value = Name of your custom action method

On my computer it looks like this:

MMsiBreakScreenShot

In my example it will break for debugging when Windows Installer is executing the CA GetWebSites. When that happens you will get the following dialog:

MMsiBreakScreenShot2

Select Yes and you will be prompted to select a debugger to use. If you already have your solution open in VS, you will get the option of using that. Note however that on Vista admin privileges is required, so you need to have your Visual Studio running as admin in order for it to bee listed in the below screen:

MMsiBreakScreenShot3

When I select the running VS (as above I’ve done above) I get something in VS which I can’t quite explain. The first time this happened to me I thought it didn’t work. I get this message:

MMsiBreakScreenShot4

The thing is that the source code is of course already displayed, but I thought there was some problems with loading the symbols. However, if you just click Ok and hit F5 (Start debugging) in VS, your breakpoint will hit. Just a thing to be aware of if you get this.

Using Message Box

By using a message box you can accomplish the same thing, but this requires changes to your code and a recompile of both your CA project and you WiX project. Personally I prefer the above method, but it’s always nice to have options :-)

In order to debug using message box you must:

  1. Make sure you have a reference to System.Windows.Forms.dll.
  2. Somewhere in your code (where you want to break) add some code for displaying your message box. Something like this:
    MessageBox.Show("Please attach a debugger.");
  3. Add a breakpoint somewhere in your code below your message box code
  4. Rebuild your CA project as well as you WiX project to get the new changes.
  5. Run your MSI.
  6. When the message box displays, go to Tools –> Attach to Process… (Ctrl + Alt + P)
  7. Find the process named rundll32.exe and attach.
  8. Click Ok on the message box in you installation.
  9. The breakpoint you set earlier should now be activated in VS

Using Debugger.Launch()

This is exactly the same as using MMsiBreak except you trigger it from code instead of a environment variable. Just add this line to your code where you want to debug:

System.Diagnostics.Debugger.Launch();

This will give you the same “Unhandled exception” dialog as before and the rest is the same.

The MSI log file

If you’ve been working with MSI’s you know this already, but I think this is something every developer/it-expert should know about and in my experience most people don’t. Sometimes when you run an MSI and get an error that maybe causes a rollback and you can’t get the installation to install, you’re stuck with a cryptic error message. If you’re lucky you can Google it and maybe find the problem (or solution), but often this is not the case. Then this little command might come in handy:

msiexec /i NameOfMSI.msi /l*v C:\Temp\install.log

The above command uses msiexec.exe which is what Windows uses when you double click on an msi. Actually Windows does exactly like the above except from the /l*v part and that’s where you tell msiexec to log to a file. Here’s what it means:

/l = Log
* = Everything
v = Verbose

You can skip the v and you will get slightly smaller log file. Personally I use v all the time.

Sunday, October 26, 2008 7:33:58 PM (W. Europe Standard Time, UTC+01:00)
Saturday, October 11, 2008

WixVS Earlier this week I posted a question on the WiX user list. The question was: Which version of WiX is being distributed with Visual Studio 2010?

As you probably know by know (at least if your interested in msi and deployment) is that WiX will ship as part of Visual Studio 2010. To make a long story short, the answer is 3.0. This was expected, but I was still curious. Having WiX v. 3.0 with VS means that all developers have the option to create advanced installations using Windows Installer, and also to create Custom Actions (CA’s) in managed code!

Saturday, October 11, 2008 12:33:05 AM (W. Europe Daylight Time, UTC+02:00)
Tuesday, May 27, 2008

Brian Harry over at the TFS team has a great post about the new features that will be available in the coming SP1 for TFS 2008.

Tuesday, May 27, 2008 7:47:50 AM (W. Europe Daylight Time, UTC+02:00)
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)
Tuesday, February 26, 2008

You might argue both, but that's beyond the point :-) I've been thinking lately about how different programmers get their work done. If you look over the shoulders to 3 programmers, none of them is working the same way. The first difference I tend to notice is the use of keyboard shortcuts. Personally I've always been a fan of shortcuts, especially in development environments like Visual Studio, but also general shortcuts in Windows or other applications. For instance I never do File -> Open. I always use ctrl -> O and it always annoys me when a program does not support the most common shortcuts. However, I still feel I can learn and use more of them.

We can divide developers into three groups related to the above:

  1. Love the mouse and rarely use shortcuts
  2. Use mouse often, but use shortcuts for the most common actions
  3. Use the mouse only when there's no shortcut for the action.

I think I can put myself in category 2 and I'm not sure if I want to or are able to be in category 3. One important aspect to consider before I dig myself to deep into this, is that you don't necessarily produce better software by using a lots of shortcuts (obviously). However I'm quite sure that a developer in group 3 produce code faster than a group 1 developer. But one can argue (if you're a bit extreme) that the quality of the code produced by group 1 is better, because they get more time to think :-) But seriously you can't use this type of groupings for defining developers, but in general I think many developers could benefit from using more shortcuts.

Here are the most common shortcuts in Visual Studio 2005 as I see it:

Builds    
Ctrl+B, Ctrl+S Build BuildSelection
Ctrl+Shift+B Build BuildSolution
Ctrl+Break Build Cancel
     
Debugging    
F5 Debug Start
Ctrl+F5 Debug StartWithoutDebugging
Shift+F5 Debug StopDebugging
F10 Debug StepOver
F11 Debug StepInto
Ctrl+F10 Debug RunToCursor
Shift+F11 Debug StepOut
Ctrl+Shift+F10 Debug SetNextStatement
F9 Debug ToggleBreakpoint
Ctrl+Shift+F9 Debug DeleteAllBreakpoints
     
Navigation    
F12 Edit GoToDefinition
Ctrl+F12 Edit GoToDeclaration
     
Other    
Shift+Alt+Enter View FullScreen
Ctrl+Shift+F12 View NextError
Ctrl+Alt+P Tools AttachtoProcess
Shift+Alt+A Project AddExistingItem
Ctrl+K, Ctrl+M Edit GenerateMethodStub

You probably know where and how already, but if you go to Tools -> Options -> Keyboard in Visual Studio you can define your own shortcuts. This is a great feature of Visual Studio that let you create custom shortcuts for almost every action you can do with a mouse. You can either change an existing shortcut or define new ones. Here's a screenshot of the shortcut dialog in VS:

image

Commands are displayed alphabetically after some type of menu structure (e.g. Edit.Copy), though there a many more commands than you can find in the menu. This list is of course populated dynamically which means you'll find commands for 3rd party VS plugins like e.g. ReSharper. One thing to be aware of though is existing shortcuts. If you for instance want to have the shortcut Ctrl+V, Ctrl+A, you will override the Ctrl+V command for Paste, which is probably not what you want.

Tuesday, February 26, 2008 2:53:51 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)
Monday, November 05, 2007
VSOrcas.gifThe wait is almost over. At TechEd Barcelona Microsoft announced the release date of Visual Studio 2008 and .Net Framework 3.5. Check out the official press release here: http://www.microsoft.com/presspass/press/2007/nov07/11-05TechEdDevelopersPR.mspx

.Net | Events | TechEd | Tools | VisualStudio
Monday, November 05, 2007 11:36:07 PM (W. Europe Standard Time, UTC+01: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)
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)
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)
Sunday, April 22, 2007
VSOrcas.gifBeta 1 is now available and you'll find it here: http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx. I think you'll either need a MSDN subscription to get it or Virtual PC (you can download the Orcas vpc image here). Enjoy!

Sunday, April 22, 2007 9:43:19 AM (W. Europe Daylight Time, UTC+02:00)
Wednesday, January 24, 2007
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)
Wednesday, January 17, 2007
NNUG.jpgJust wanted to let you know that we have put out the agenda for the january meeting at NNUG in Bergen. You'll find it here: http://www.nnug.no/Avdelinger/Bergen/Moter/Brukergruppemote-Januar/. Don't forget to register so we know how much food to order. See you there.

Wednesday, January 17, 2007 12:33:45 AM (W. Europe Standard Time, UTC+01:00)
Friday, December 15, 2006
During the day I found two new releases. Asp.net Ajax RC is out (http://ajax.asp.net/) and Visual Studio 2005 SP1 is released (http://msdn.microsoft.com/vstudio/support/vs2005sp1/default.aspx). I vote for Monday releases, so we can get paid testing them. Since I can’t keep my hands off these two, my weekend is ruined! :) Enjoy!

Update: You might want to have a look at Scott Guthrie’s blog before running the installation. He has some tips you should have a look at. Both for pre Vista and Vista operation systems. You'll find his post on vs sp1 here and vista here.
.Net | Ajax | Web | VisualStudio
Friday, December 15, 2006 1:00:00 AM (W. Europe Standard Time, UTC+01:00)
RSS RSS - Comments Twitter LinkedIn
         
SEARCH
 
 
         
TOP POSTS
   
         
NAVIGATION
   
         
CATEGORIES
  .Net (61) ADFS (3) Agile (30) Ajax (5) Architecture (20) Articles (1) ASP.NET (6) ASP.NET-MVC (1) Blogging (12) Books (2) BPEL (1) CleanCode (1) CloudComputing (7) Community (4) CSharp (11) DasBlog (5) Database (2) DDD (5) Deployment (16) DSL (1) Events (38) ExtremeProgramming (6) Fun (6) Gadgets (4) IIS (10) InfoQ (4) Java (2) Lean (3) Linq (2) MemoryLeaks (5) Microsoft (37) MVC (1) NDC (2) NNUG (36) Other (10) Patterns (9) Performance (3) Scrum (17) Security (7) ServiceBus (1) Silverlight (4) Software (19) TeamManagement (11) TechEd (7) Testing (4) Tools (25) TvGuide (1) WCF (8) Web (15) WebDeploy (1) WIF (3) Windows (10) Vista (15) VisualStudio (16) WiX (9) Work (16) Workflow (3)  
         
ARCHIVE
   
         
BLOGROLL
   
         
ON THIS PAGE...
 
The Future of Microsoft .NET Programming Languages
A few interesting tings about Visual Studio 2010
WiX and DTF: Debug a Managed Custom Action and how to generate an MSI log
Which version of WiX is going to be distributed with VS 2010
New features in TFS2008 SP1
Installing TFS 2008 when DVD and key is missing
Are you developing software with a keyboard or mouse?
Visual Studio 2008 RTM
Visual Studio 2008 and .Net Framework 3.5 to be released late November
TV Program Guide - LINQ
SQL Server 2008 will not be released but launched
Release date for Visual Studio 2008, Windows Server 2008 and SQL Server 2008 are official
Visual Studio (Orcas) Beta 1
MSDN Live in Bergen
NNUG Meeting
Asp.net AJAX RC and Visual Studio 2005 SP1