--- SolutionTask.cs	31 Aug 2003 12:11:09 -0000	1.10
+++ SolutionTask.cs	1 Sep 2003 14:57:53 -0000
@@ -23,6 +23,9 @@
 using System.Globalization;
 using System.IO;
 using System.Xml;
+using System.Security.Permissions;
+
+using Microsoft.Win32;
 
 using NAnt.Core;
 using NAnt.Core.Attributes;
@@ -30,7 +33,11 @@
 using NAnt.Core.Util;
 using NAnt.VSNet.Types;
 
+//[assembly:RegistryPermissionAttribute(SecurityAction.RequestOptional,
+//                Read=@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders")]
+
     /// <summary>
     /// Compiles VS.NET solutions (or sets of projects), automatically determining project dependencies from inter-project references.
     /// </summary>
@@ -112,6 +119,7 @@
     ///     ]]>
     ///   </code>
     /// </example>
+
     [TaskName("solution")]
     public class SolutionTask : Task {
         #region Public Instance Constructors
@@ -124,6 +132,7 @@
             _referenceProjects = new FileSet();
             _excludeProjects = new FileSet();
             _webMaps = new WebMapCollection();
+            _assemblyFolders = null;
         }
 
         #endregion Public Instance Constructors
@@ -216,11 +225,53 @@
             set { _excludeProjects = value; }
         }
 
+        /// <summary>
+        /// Set of paths where references are searched when not found in path from project file (HintPath).
+        /// Default list is in DefaultAssemlyFolders property
+        /// </summary>
+        [FileSet("assemblyfolders", Required=false)]
+        public FileSet AssemblyFolders
+        {
+            get { return _assemblyFolders; }
+            set { _assemblyFolders = value; }
+        }
+
+        /// <summary>
+        /// Default set of paths where references are searched when not found in path from project file (HintPath).
+        /// </summary>
+        public FileSet DefaultAssemlyFolders
+        {
+            get { return FindDefaultAssemblyFolders(); }
+        }
+
         #endregion Public Instance Properties
 
+        #region Private functions
+
+//      [assembly:RegistryPermissionAttribute(SecurityAction.RequestOptional,
+//                    Read=@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders")]
+        //how to check that security check? what about platforms without registry?
+        private FileSet FindDefaultAssemblyFolders()
+        {
+            FileSet fsFolders = new FileSet();
+
+            RegistryKey mainKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\7.1\AssemblyFolders");
+            if (mainKey == null) return fsFolders;
+            foreach(string subkey in mainKey.GetSubKeyNames())
+            {
+                RegistryKey subKey = mainKey.OpenSubKey(subkey);
+                string val = subKey.GetValue("").ToString();
+                fsFolders.Includes.Add(val);
+            }
+            return fsFolders;
+        }
+
+        #endregion
+
         #region Override implementation of Task
 
@@ -299,6 +350,7 @@
         private FileSet _referenceProjects;
         private FileSet _excludeProjects;
         private WebMapCollection _webMaps;
+        private FileSet _assemblyFolders;
 
         #endregion Private Instance Fields
     }
--- Project.cs	27 Aug 2003 05:17:40 -0000	1.16
+++ Project.cs	1 Sep 2003 14:58:47 -0000
@@ -274,6 +274,8 @@
                 foreach (Reference reference in _htReferences.Values) {
                     Log(Level.Verbose, LogPrefix + " - " + reference.Name);
 
+                    reference.ResolveFolder();
+
                     if (reference.CopyLocal) {
                         if (reference.IsCreated) {
                             string program, commandLine;
@@ -319,7 +321,7 @@
                     }
                 }
 
-                // Add the compiled files
+                // Add the files to compile
                 foreach (string file in _htFiles.Keys) {
                     sw.WriteLine(@"""" + file + @"""");
                 }
@@ -381,7 +383,7 @@
                 bSuccess = false;
             } else {
                 if (_isWebProject) {
-                    Log(Level.Info, LogPrefix + "Uploading output files...");
+                    Log(Level.Verbose, LogPrefix + "Uploading output files...");
                     WebDavClient wdc = new WebDavClient(new Uri(_webProjectBaseUrl));
                     //wdc.DeleteFile( cs.FullOutputFile, cs.RelativeOutputPath.Replace(@"\", "/") + _ps.OutputFile );
                     wdc.UploadFile(cs.FullOutputFile, cs.RelativeOutputPath.Replace(@"\", "/") + _projectSettings.OutputFile);
--- Reference.cs	26 Aug 2003 18:47:07 -0000	1.11
+++ Reference.cs	1 Sep 2003 14:59:30 -0000
@@ -25,6 +25,7 @@
 using Microsoft.Win32;
 
 using NAnt.Core;
+using NAnt.Core.Types;
 using NAnt.VSNet.Tasks;
 
 namespace NAnt.VSNet {
@@ -219,6 +220,34 @@
             }
 
             return referencedFiles;
+        }
+
+
+        /// <summary>
+        /// Search for Filename. First in path provided then in set of paths from tag &lt;assemblyfolders&gt;
+        /// </summary>
+        public void ResolveFolder()
+        {
+            if (_isSystem) return;  //do not resolve system assemblies (as System.Data)
+
+            FileInfo fiRef = new FileInfo(_referenceFile);
+            if ( fiRef.Exists ) return; //referenced file found - no other tasks required
+
+            string justFilename = fiRef.Name;
+
+            FileSet af = _solutionTask.AssemblyFolders;
+            if(af.DirectoryNames.Count==0) af=_solutionTask.DefaultAssemlyFolders;
+
+            foreach(string path in _solutionTask.AssemblyFolders.DirectoryNames)
+            {
+                fiRef = new FileInfo(Path.Combine(path,justFilename));
+                if ( fiRef.Exists )
+                {
+                    _referenceFile = fiRef.FullName;
+                    _baseDirectory = fiRef.DirectoryName;
+                    return;
+                }
+            }
         }
 
         #endregion Public Instance Methods
--- Solution.cs	27 Aug 2003 15:48:48 -0000	1.11
+++ Solution.cs	1 Sep 2003 15:00:59 -0000
@@ -202,7 +202,7 @@
 
                         if (!failed) {
                             // Fixup references
-                            Log(Level.Info, LogPrefix + "Fixing up references...");
+                            Log(Level.Verbose, LogPrefix + "Fixing up references...");
 
                             foreach (Reference reference in p.References) {
                                 // store original reference filename
@@ -356,7 +356,7 @@
         }
 
         private void LoadProjects() {
-            Log(Level.Info, LogPrefix + "Loading projects...");
+            Log(Level.Verbose, LogPrefix + "Loading projects...");
 
             FileSet excludes = _solutionTask.ExcludeProjects;
             foreach (DictionaryEntry de in _htProjectFiles) {
@@ -372,7 +372,7 @@
         }
 
         private void GetDependenciesFromProjects() {
-            Log(Level.Info, LogPrefix + "Gathering additional dependencies...");
+            Log(Level.Verbose, LogPrefix + "Gathering additional dependencies...");
 
             // First get all of the output files
             foreach (DictionaryEntry de in _htProjects) {

