I have taken a little time now to analyze the issue in more detail and here is what I have found in my environment (not sure whether my findings will apply to general solution as well):
1. Where the problem occures:
in the config.UpdateMachineKey function the following statement has set the xmlMachineKey to "Nothing" which in the following will finally cause the problems described:
Dim
xmlMachineKey As XmlNode = xmlConfig.SelectSingleNode("configuration/system.web/machineKey")
2. Why does this problem occure
When analysing my web.config I have found in the first line the <configuraiton> node has been "enriched" with an "additional" xmlns attribute as follows:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
With is different from the "empty" <configuration> tag proposed by the initial release.config.
Some testing then verified that the SelectSingleNode function will return "Nothing" when this xmlns attribute is present (I am not sure whether this is a generic bug in ASP.NET 2.0 or not).
3. Solution:
I have removed the xmlsn attribute from the <configuration> tag so that it is <configuration> alone that makes the first line of web.config and Hurra! all works fine now!
4. Pending Question
a) cause of the "enriched" <configuration> tag
Currently I do not have a clue how this xmlsn attribute has come into the <configuration> tag. Maybe it has come with a 3rd party XML tool that is "overcorrecting" missing attributes. As I am just using Microsoft and Adobe standard development tools the solution might not be to far searched. If you have an idea - just let me know.
b) According to my view the SelectSingleNode() function should be able to deal with such "enriched" as well and must not return "Nothing" when dealing with it. Maybe I am wrong, maybe its a general bug in ASP.NET.
So if you are an expert in this - any comments are welcome!
Kind regards
Rene