vrijdag 23 oktober 2009

msiexec != installutil

Some months ago I've developed a custom install action which allows installation of BizTalk applications through an msi installation. To do this I derived a class from the Installer class.
When you do this you have the ability to log some actions by the use of:

base.Context.LogMessage("Installation started.");

At least, that was what I thought... When I supplied the neccesary parameters to enable logging to the msi (xxx.msi /l* log.txt) I got a nice log.txt with a lot of logging...but the logging I supplied was nowhere to see in the file! Strange, so I went to MSDN (http://msdn.microsoft.com/en-us/library/system.configuration.install.installcontext.logmessage.aspx) to lookup the use of this particular method. Didn't help me a lot to be honest.

So I fired up Reflector to see what this method does.

public void LogMessage(string message)
{
this.logFilePath = this.Parameters["logfile"];
if ((this.logFilePath != null) && !"".Equals(this.logFilePath))
{
StreamWriter writer = null;
try
{
writer = new StreamWriter(this.logFilePath, true, Encoding.UTF8);
writer.WriteLine(message);
}
finally
{
if (writer != null)
{
writer.Close();
}
}
}
if (this.IsParameterTrue("LogToConsole") || (this.Parameters["logtoconsole"] == null))
{
Console.WriteLine(message);
}
}


As you can see the method expects some parameters to be set. Especially the 'logtoconsole' parameter. So when I then added the custom action to a Visual Studio Setup project I did not have my customized logging.

I have not got it to work with my custom logging. Anyone has an idea of how to log your log entries from your custom action in the msi.log file? Now I do not have custom action logging in the log file, which is not good. Strange that Microsoft has no article about this problem. I hope they will fix this some time...

woensdag 5 augustus 2009

A new beginning

Tomorrow (6th of august) Windows 7 will be available to MSDN subscribers, which I am. Hooray! I'm already running the RC and I have to say it is great. I'm going to work with the RC until it expires. But probably on my home pc I will change the OS from Vista to Seven!

dinsdag 4 augustus 2009

Strong name validation failed

Today I faced a problem which took me way too long to solve. I had a project which I wanted to unit test with Visual Studio 2008 and MS Test. As a good developer I sign my assemblies with a snk file.

I created a test project and the necessary unit tests. When I ran the unit test in debug mode the passed (well…the one that were implemented). But when I ran the test without debugging they all failed! Because it was not possible for me to track the thrown exception during a normal test run (due to a WCF service which thrown a totally different exception) I had to add some logging in between to trap the exception in a .txt file.

The exception thrown was:

System.IO.FileLoadException: Could not load file or assembly ‘xxxxxx’ or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

File name: ‘xxxxxx’ ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)

Weird…I did sign the assembly. And yes when I looked at the project properties the assembly was indeed signed.

image

When I tried to add the assembly of the bin/debug folder of the project to the GAC it succeeded. So it really was signed, else no GAC! For each test run Visual Studio creates a directory TestResults\timg_TIMG01 2009-08-04 19_41_49 (or something similar)

When I tried to add the wretched assembly from the Out directory of the test directory to the GAC I got the folowing error.

Failure adding assembly to the cache: Strong name signature could not be verified. Was the assembly built delay-signed?

No it is not! After that I used the following sn command:

sn –v MyProject.dll

MyProject.dll is a delay-signed or test-signed assembly

How come? I really did sign the assembly! Few frustration later I called a colleague of me who already did much more with MS Test then me. He told me that I had to see if I had enabled code coverage for the assembly. Indeed I had turned on code coverage for my assembly. When I opened the windows I already saw what was going wrong.

image

I had to define my snk file also here or I could turn of code coverage. Took me way too long to solve this problem but again a lesson learned!

dinsdag 21 juli 2009

BizTalk 2006 EventID: 5410 (out-of-memory)

Recently I was with a customer who’s BizTalk server kept crashing immediately after starting the BizTalk server service. A quick look in the eventviewer showed the following error:

--- An error occurred that requires the BizTalk service to terminate. The most common causes are the following: 1) An unexpected out of memory error. OR 2) An inability to connect or a loss of connectivity to one of the BizTalk databases. The service will shutdown and auto-restart in 1 minute. If the problematic database remains unavailable, this cycle will repeat. Error message: Exception has been thrown by the target of an invocation. Error source: mscorlib …………….----

The first thing I did was shutting down all BizTalk applications that were running on the server. After I did that I restarted the BizTalk server again. No success…

Then I remembered that a fellow team member of me changed the custom config that was referenced by btsntsvc.exe.config. I opened the custom config file in Notepad++ and with the XML tools plugin I checked the validity of the config file. The config file was invalid XML so it was not possible for the BizTalk service to load the config into it’s appdomain.

Lesson learned: always check the validity of you config files!

maandag 8 juni 2009

Bing with suggestions

I have to admit the new Microsoft search Bing is just great! I love the search suggestions and web slices it shows. Also it's really nice to see video results without leaving the Bing search site! After a week of use I can say Bing will replace (for me) Google. IF it get's localized properly, now there are a few issues but most localized versions are still in beta stage so it's admitted ;-)

You can download the IE8 search provider here: http://www.ieaddons.com/en/details/searchhelpers/Bing_Search/

But beware! If you have setup IE8 to use another language then English (Tools-Internet Options-Languages), search suggestions and other neat Bing stuff will not work. You have to change this manually.


  1. Open regedit
  2. Browse to the following key: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes
  3. In the subkeys of the above key search for a key where the URL string value is equal to www.bing.com
  4. Open up the SuggestionsURL string value and replace {language} with en-us (it will now look like: http://api.bing.com/qsml.aspx?query={searchTerms}&market=en-us&form=IE8SSC&maxwidth={ie:maxWidth}&rowheight={ie:rowHeight}§ionHeight={ie:sectionHeight})
  5. Close regedit and fire up IE8 and you'll have search suggestions!

Have fun with it, it's really awesome!

woensdag 3 juni 2009

Windows 7 approaching


Microsoft will deliver Windows 7 to personal computers by the 22nd of october! This is great news! I love this OS so much and want to upgrade my desktop at home with the same great OS that runs on my laptop. With my MSDN license I'll probably will have this new OS a bit earlier. (I hope so ;-))


dinsdag 2 juni 2009

RC Mayhem! (Part 1)

Last weekend we had a prolonged weekend in Belgium due to a catholic holiday. As I am passionate about my job (as most of you will be) I used my spare time to mess around with some IT related stuff.

This time it was time to take a look at the following items:

Great! I have 3 days time to get this all working on my Dell Latitude D830 laptop from work! No biggy!

Specifications of my machine:

  • Intel Core 2 Duo T7800 @ 2,6GHz
  • 4GB RAM
  • Nvidia Quadro NVS 140M 256MB RAM
  • DVD Writer
  • …More useful techno sweetness.

Windows 7 RC

After downloading the RC with my MSDN account (which took way too long with my Belgian ISP Scarlet (3,3MBIT / Limited)), I burned the ISO on a DVD+RW from Memorex with Nero Burning Rom. First time FAIL! The DVD didn’t boot in my D830. I first thought the burn was corrupted, so I erased the DVD and burned it once again. Second fail! Einstein says “if it doesn’t work the second time try the same a third time and stupidity will prove it will never work!” As I am not stupid I tried a third time with a different approach.

Check the MSDN provided MD5 hash of the ISO image. Could be the image was corrupted by download! So I searched for an MD5 checksum program and found one on Bart de Smet’s blog. Could write it myself, but hey why to reinvent the wheel?! After all the MD5 hash matched the one from MSDN. Took a DVD+R from Verbatim burned it again…Success! Never had problems with good ol’ Verbatim. :-)

I booted the freshly burned Windows 7 RC DVD (x64) and formatted my Windows Vista partition and installed this piece of software. Installs pretty fast on my D830 (15mins)! It detects every piece of hardware in my laptop automatic! Connecting to my home Wireless network was a breeze! Windows 7 downloaded the newest drivers for the Nvidia graphics card and that’s that! No browsing on the internet for third party drivers or other custom made drivers! Out of the box experience at it’s best! That were a lot of exclamation marks, but I was amazed! Oops sorry last one :-)

Visual Studio 2008 + SQL Server 2008

Those 2 development tools are the defacto development tools in my branch. So I first installed SQL Server 2008 development edition. I was getting a few software problem dialogs that I had to update to SP1 of SQL Server 2008. No problem, I will do that after everything is OK! I Installed a default instance of SQL Server 2008 and watched it work flawless with Windows 7. The SP1 dialogs were gone so I didn’t thought about it any further.

I put on my working boots and installed Visual Studio 2008 Team Developer. Only needed C# installation (no Crystal Reports for me)… After grabbing a cup of coffee (or two) the installation completed successfully. Sweet, let’s try it. First thing I mentioned, I missed the C# icons in the splashscreen. Disaster strikes! I got the C# project tree item but it missed the project items. No C#? I do not like that! Reinstalled the whole bunch again with the same settings. Failed! …Einstein is a genius! I uninstalled both Visual Studio 2008 and SQL Server 2008. Then I first installed Visual Studio 2008. Ha! I have C# projects. Installing SQL Server 2008…doesn’t work. It needs SP1 of VS2008. Probably this was the problem before. I had to install SP1 for SQL Server 2008 BEFORE installing VS 2008. Now I have the same problem but vice versa…

Lesson learned: If you have to install a SP for a certain program do it immediately after installation!! Windows is smart…

Now it runs like a train and I love it!

Windows Server 2008 R2 RC

Sunday…another day at the terrace. Great weather in Belgium, so I took my laptop outside on the garden terrace.

Lesson learned from the above DVD+RW debacle. I burned the ISO straight to a DVD+R from Verbatim.

My idea was to have a dual boot with Windows 7. So I leveraged a nice cool feature which was already present in Windows Vista. Native VHD boot!

First I created a fixed size (20GB) VHD in Windows 7 using the Disk Management tool.

image

Simple as right click on Disk Management and select Create VHD.

image

Specify a location for the VHD and a size. I took 20GB fixed. Because I don’t like it when I run out of space on my main OS due to a dynamic expanding disk.

Next step: Install the Windows Server 2008 R2 RC!

I booted my laptop with the W2K8R2 DVD in the drive and at the setup menu I did SHIFT + F10. This key combination shows a simple command prompt. In this command prompt you can attach the previously made VHD.

Do the following:

  1. diskpart
  2. select vdisk file=d:\win2k8.vhd <your .vhd file location goes there>
  3. attach vdisk
  4. Exit from diskpart and the command prompt

That’s it! Now go further with the installation of Windows Server 2008 R2. When selecting partition on which to install Windows Server 2008 R2, select the attached VHD partition. You’ll see warnings saying “… cannot boot from this partition”. It is safe to ignore these warnings and install Windows Server 2008 R2 on this partition.

Have fun playing with these new candies!

In Part 2 I will tell you about the difficulties I had during driver configuration in Windows Server 2008 R2. Stay tuned!

First!

First!  This is probably the lamest reply you ever can have.  But no second without a first.

This is my first weblog post and not my last.  I use Windows Live Writer 2009 to update my weblog and I must say I already like it!

I hope you’ll like my weblog and you’ll find some meaningful and handy stuff on it!

Alright let’s kick-off this weblog with a second post!