Index: Nant.Core/Project.cs
===================================================================
RCS file: /cvsroot/nant/nant/src/NAnt.Core/Project.cs,v
retrieving revision 1.15
diff -r1.15 Project.cs
53d52
< 
73d71
< 
642a641,643
>             Properties["nant.settings.defaultframework.basiccompiler"] = DefaultFramework.BasicCompilerName; 
>             Properties["nant.settings.defaultframework.jsharpcompiler"] = DefaultFramework.JSharpCompilerName; 
>             Properties["nant.settings.defaultframework.jscriptcompiler"] = DefaultFramework.JScriptCompilerName; 
659d659
<            
661a662,664
>             Properties["nant.settings.currentframework.basiccompiler"] = CurrentFramework.BasicCompilerName; 
>             Properties["nant.settings.currentframework.jsharpcompiler"] = CurrentFramework.JSharpCompilerName; 
>             Properties["nant.settings.currentframework.jscriptcompiler"] = CurrentFramework.JScriptCompilerName; 
677c680
<         // Addional routines to write      
---
>         // Addional routines to write
686c689
<             foreach( XmlNode propertyNode in propertyNodes ){               
---
>             foreach( XmlNode propertyNode in propertyNodes ){
689,690c692,693
<                                   
<                  XmlNode readonlyNode = propertyNode.Attributes["readonly"];               
---
> 
>                  XmlNode readonlyNode = propertyNode.Attributes["readonly"];
696,697c699,700
<                  }                                                       
<             }        
---
>                  }
>             }
705d707
<             
707c709
<                 XmlNode SdkDirectoryNode = frameworkNode.SelectSingleNode("sdkdirectory");
---
>                 XmlNode sdkDirectoryNode = frameworkNode.SelectSingleNode("sdkdirectory");
710,718c712,722
<                 
<                 string name = frameworkNode.Attributes["name"].Value;
<                 string description =  frameworkNode.Attributes["description"].Value;
<                 string version = frameworkNode.Attributes["version"].Value;
<                 string csharpCompilerName = frameworkNode.Attributes["csharpcompilername"].Value;
<                 string resgenToolName = frameworkNode.Attributes["resgenname"].Value;
<                 string runtimeEngine = ( frameworkNode.Attributes["runtimeengine"] != null ) ? frameworkNode.Attributes["runtimeengine"].Value : "";
<                 
<                                             
---
> 
>                 string name = GetXmlAttributeValue(frameworkNode, "name");
>                 string description =  GetXmlAttributeValue(frameworkNode, "description");
>                 string version = GetXmlAttributeValue(frameworkNode, "version");
>                 string csharpCompilerName = GetXmlAttributeValue(frameworkNode, "csharpcompilername");
>                 string basicCompilerName = GetXmlAttributeValue(frameworkNode, "basiccompilername");
>                 string jsharpCompilerName = GetXmlAttributeValue(frameworkNode, "jsharpcompilername");
>                 string jscriptCompilerName = GetXmlAttributeValue(frameworkNode, "jscriptcompilername");
>                 string resgenToolName = GetXmlAttributeValue(frameworkNode, "resgenname");
>                 string runtimeEngine = GetXmlAttributeValue(frameworkNode, "runtimeengine");
> 
722c726
<                 
---
> 
724,726c728,730
<                 if ( SdkDirectoryNode.Attributes["useregistry"] != null &&  SdkDirectoryNode.Attributes["useregistry"].Value == "true") {
<                     string regKey = SdkDirectoryNode.Attributes["regkey"].Value;                    
<                     string regValue = SdkDirectoryNode.Attributes["regvalue"].Value;
---
>                 if (GetXmlAttributeValue(sdkDirectoryNode, "useregistry") == "true") {
>                     string regKey = GetXmlAttributeValue(sdkDirectoryNode, "regkey");
>                     string regValue = GetXmlAttributeValue(sdkDirectoryNode, "regvalue");
728c732
<                     
---
> 
733c737
<                     sdkDirectory =  SdkDirectoryNode.Attributes["dir"].Value;
---
>                     sdkDirectory =  GetXmlAttributeValue(sdkDirectoryNode, "dir");
735,738c739,742
<                 
<                 if ( frameworkDirectoryNode.Attributes["useregistry"] != null &&  frameworkDirectoryNode.Attributes["useregistry"].Value == "true" ) {
<                     string regKey = frameworkDirectoryNode.Attributes["regkey"].Value;
<                     string regValue = frameworkDirectoryNode.Attributes["regvalue"].Value;
---
> 
>                 if (GetXmlAttributeValue(frameworkDirectoryNode, "useregistry") == "true" ) {
>                     string regKey = GetXmlAttributeValue(frameworkDirectoryNode, "regkey");
>                     string regValue = GetXmlAttributeValue(frameworkDirectoryNode, "regvalue");
741c745
<                     if ( frameworkKey  != null && frameworkKey.GetValue(regValue) != null ) {                    
---
>                     if ( frameworkKey  != null && frameworkKey.GetValue(regValue) != null ) {
745c749
<                     frameworkDirectory =  frameworkDirectoryNode.Attributes["dir"].Value;
---
>                     frameworkDirectory =  GetXmlAttributeValue(frameworkDirectoryNode, "dir");
748,750c752,754
<                 if ( frameworkAssemDirectoryNode.Attributes["useregistry"] != null &&  frameworkAssemDirectoryNode.Attributes["useregistry"].Value == "true"){
<                     string regKey = frameworkAssemDirectoryNode.Attributes["regkey"].Value;
<                     string regValue = frameworkAssemDirectoryNode.Attributes["regvalue"].Value;
---
>                 if (GetXmlAttributeValue(frameworkAssemDirectoryNode, "useregistry") == "true") {
>                     string regKey = GetXmlAttributeValue(frameworkAssemDirectoryNode, "regkey");
>                     string regValue = GetXmlAttributeValue(frameworkAssemDirectoryNode, "regvalue");
753c757
<                     if ( frameworkAssemKey  != null && frameworkAssemKey.GetValue(regValue) != null ) {                    
---
>                     if ( frameworkAssemKey  != null && frameworkAssemKey.GetValue(regValue) != null ) {
757c761
<                     frameworkAssemblyDirectory =  frameworkAssemDirectoryNode.Attributes["dir"].Value;
---
>                     frameworkAssemblyDirectory =  GetXmlAttributeValue(frameworkAssemDirectoryNode, "dir");
759c763
<                 
---
> 
768a773,775
>                                             basicCompilerName,
>                                             jsharpCompilerName,
>                                             jscriptCompilerName,
770c777
<                                             runtimeEngine );                
---
>                                             runtimeEngine );
775,777c782,784
<                 if ( info != null ) {                    
<                     _frameworkInfoTable.Add( info.Name, info );   
<                 }                                                            
---
>                 if ( info != null ) {
>                     _frameworkInfoTable.Add( info.Name, info );
>                 }
779a787,811
> 
>         /// <summary>
>         /// Gets the value of the specified attribute from the specified node.
>         /// </summary>
>         /// <param name="xmlNode">The node of which the attribute value should be retrieved.</param>
>         /// <param name="attributeName">The attribute of which the value should be returned.</param>
>         /// <returns>
>         /// The value of the attribute with the specified name or <c>null</c> if the attribute
>         /// does not exist or has no value.
>         /// </returns>
>         private static string GetXmlAttributeValue(XmlNode xmlNode, string attributeName) {
>             string attributeValue = null;
> 
>             if (xmlNode != null) {
>                 XmlAttribute xmlAttribute = (XmlAttribute) xmlNode.Attributes.GetNamedItem(attributeName);
>                 if (xmlAttribute != null) {
>                     attributeValue = xmlAttribute.Value.Trim();
>                     if (attributeValue.Length == 0) {
>                         attributeValue = null;
>                     }
>                 }
>             }
> 
>             return attributeValue;
>         }
794c826
<                 // todo pull a settings file out of the assembly resource and copy to that location                          
---
>                 // todo pull a settings file out of the assembly resource and copy to that location
804c836
<             string defaultFramework = node.Attributes["defaultframework"].Value;
---
>             string defaultFramework = GetXmlAttributeValue(node, "defaultframework");
807c839
<                 Properties.AddReadOnly("nant.settings.defaultframework", defaultFramework );                                                   
---
>                 Properties.AddReadOnly("nant.settings.defaultframework", defaultFramework );
811c843
<                 CurrentFramework = _defaultFramework;                                                                              
---
>                 CurrentFramework = _defaultFramework;
815c847
<             }                              
---
>             }
