diff -c -w -r nant-0.85-20040212 - before/src/NAnt.VSNet/Project.cs nant-0.85-20040212 - after/src/NAnt.VSNet/Project.cs
*** nant-0.85-20040212 - before/src/NAnt.VSNet/Project.cs	Sat Feb 07 22:14:10 2004
--- nant-0.85-20040212 - after/src/NAnt.VSNet/Project.cs	Thu Feb 19 21:21:26 2004
***************
*** 31,36 ****
--- 31,38 ----
  using NAnt.Core.Tasks;
  using NAnt.Core.Types;
  using NAnt.Core.Util;
+ using NAnt.DotNet.Tasks;
+ using NAnt.DotNet.Types;
  using NAnt.VSNet.Tasks;

  namespace NAnt.VSNet {
***************
*** 244,249 ****
--- 246,252 ----

  		public override bool Compile(string configuration, ArrayList alCSCArguments, string strLogFile, bool bVerbose, bool bShowCommands) {
  			bool bSuccess = true;
+ 			bool haveCultureSpecificResources = false;

  			ConfigurationSettings cs = (ConfigurationSettings) _htConfigurations[configuration];
  			if (cs == null) {
***************
*** 353,358 ****
--- 356,366 ----
  				if (_htResources.Count > 0) {
  					Log(Level.Verbose, LogPrefix + "Compiling resources:");
  					foreach (Resource resource in _htResources.Values) {
+ 						// Ignore resource files associated with a culture
+ 						if ( resource.Culture != null ) {
+ 							haveCultureSpecificResources = true;
+ 							continue;
+ 						}
  						Log(Level.Verbose, LogPrefix + " - {0}", resource.InputFile);
  						resource.Compile(cs, bShowCommands);
  						sw.WriteLine(resource.Setting);
***************
*** 455,460 ****
--- 463,520 ----
  				}
  			}

+ 			#region Process culture-specific resource files...
+ 			// Based on http://www.mail-archive.com/nant-developers@lists.sourceforge.net/msg01956.html
+ 			if ( bSuccess && haveCultureSpecificResources ) {
+ 				Log(Level.Verbose, LogPrefix + "Compiling satellite resources:");
+ 				Hashtable cultures = new Hashtable ( );
+ 				foreach (Resource resource in _htResources.Values) {
+ 					// Ignore resource files NOT associated with a culture
+ 					if ( null == resource.Culture ) {
+ 						continue;
+ 					}
+ 					ArrayList resFiles = null;
+ 					if ( !cultures.ContainsKey ( resource.Culture ) ) {
+ 						resFiles = new ArrayList ( );
+ 						cultures.Add ( resource.Culture, resFiles );
+ 					}
+ 					else {
+ 						resFiles = (ArrayList) cultures[resource.Culture];
+ 					}
+ 					resFiles.Add ( resource );
+ 				}
+
+ 				foreach ( DictionaryEntry de in cultures ) {
+ 					string culture = (string) de.Key;
+ 					ArrayList resFiles = (ArrayList) de.Value;
+
+ 					AssemblyLinkerTask al = new AssemblyLinkerTask ( );
+ 					al.Project = this.SolutionTask.Project;
+ 					al.Parent = this.SolutionTask.Parent;
+ 					al.BaseDirectory = cs.OutputDir;
+ 					al.InitializeTaskConfiguration ( );
+
+ 					string satellitePath = cs.OutputDir.FullName;
+ 					satellitePath = Path.Combine ( satellitePath, culture );
+ 					Directory.CreateDirectory ( satellitePath );
+ 					satellitePath = Path.Combine ( satellitePath, String.Format ( "{0}.resources.dll", _projectSettings.AssemblyName ) );
+ 					al.OutputFile = new FileInfo ( satellitePath );
+ 					al.OutputTarget = "lib";
+ 					al.Culture = culture;
+ 					al.TemplateFile = new FileInfo ( Path.Combine ( cs.OutputDir.FullName, _projectSettings.OutputFileName ) );
+ 					foreach ( Resource resource in resFiles ) {
+ 						string outFile = resource.Compile(cs, bShowCommands);
+ 						al.Resources.Includes.Add ( outFile );
+ 					}
+ 					// run assembly linker
+ 					SolutionTask.Project.Indent ( );
+ 					Log(Level.Verbose, LogPrefix + " - {0}", culture);
+ 					al.Execute ( );
+ 					SolutionTask.Project.Unindent ( );
+ 				}
+ 			}
+ 			#endregion
+
  			if (ProjectSettings.RunPostBuildEvent != null) {
  				if (!PostBuild(cs, (exitCode == 0) ? true : false, (exitCode == 0) ? true : false)) {
  					bSuccess = false;
diff -c -w -r nant-0.85-20040212 - before/src/NAnt.VSNet/Resource.cs nant-0.85-20040212 - after/src/NAnt.VSNet/Resource.cs
*** nant-0.85-20040212 - before/src/NAnt.VSNet/Resource.cs	Sun Dec 28 21:47:12 2003
--- nant-0.85-20040212 - after/src/NAnt.VSNet/Resource.cs	Thu Feb 19 21:03:05 2004
***************
*** 42,47 ****
--- 42,70 ----
  			_resourceSourceFileRelativePath = resourceSourceFileRelativePath;
  			_dependentFile = dependentFile;
  			_solutionTask = solutionTask;
+ 			#region Determine this resource's culture (if any) from its filename
+ 			// the default is no culture
+ 			_culture = null;
+ 			string withoutFirstExtension = Path.GetFileNameWithoutExtension ( resourceSourceFile.FullName );
+ 			// It is possible for the file name to still have periods (.) in it.
+ 			if ( withoutFirstExtension.IndexOf ( '.' ) != -1 ) {
+ 				// retrieve the second extension
+ 				string secondExtension = Path.GetExtension ( withoutFirstExtension );
+ 				// Path.GetExtension also returns "." at the beginning of the string, remove it.
+ 				secondExtension = secondExtension.Replace ( ".", "" );
+ 				// Check to see if secondExtension is a valid Culture name.
+ 				// TODO: optimize this later, because it is O(resourceCount * cultureCount)...
+ 				// plus the time to generate the array every time.
+ 				// I recommend using a hashtable of culture names that is cached.
+ 				CultureInfo[] allCultures = CultureInfo.GetCultures ( CultureTypes.AllCultures );
+ 				foreach ( CultureInfo currentCulture in allCultures ) {
+ 					if ( secondExtension.ToLower ( CultureInfo.InvariantCulture )
+ 						== currentCulture.Name.ToLower ( CultureInfo.InvariantCulture ) ) {
+ 						_culture = secondExtension;
+ 					}
+ 				}
+ 			}
+ 			#endregion
  		}

          #endregion Public Instance Constructors
***************
*** 60,70 ****
              get { return _project; }
          }

          #endregion Public Instance Properties

          #region Public Instance Methods

!         public void Compile(ConfigurationSettings configurationSettings, bool showCommands) {
              switch (InputFile.Extension.ToLower()) {
                  case ".resx":
                      _compiledResourceFile = CompileResx();
--- 83,99 ----
  			get { return _project; }
  		}

+ 		public string Culture {
+ 			get {
+ 				return _culture;
+ 			}
+ 		}
+
          #endregion Public Instance Properties

          #region Public Instance Methods

! 		public string Compile(ConfigurationSettings configurationSettings, bool showCommands) {
  			switch (InputFile.Extension.ToLower()) {
  				case ".resx":
  					_compiledResourceFile = CompileResx();
***************
*** 76,81 ****
--- 105,111 ----
  					_compiledResourceFile = CompileResource();
  					break;
  			}
+ 			return _compiledResourceFile;
  		}

          #endregion Public Instance Methods
***************
*** 233,238 ****
--- 263,269 ----
  		private string _resourceSourceFileRelativePath;
  		private Project _project;
  		private SolutionTask _solutionTask;
+ 		private string _culture;

          #endregion Private Instance Fields
  	}
