2008-11-18 Marek Habersack <mhabersack@novell.com>
[mono.git] / mcs / class / System.Web / System.Web.Compilation / AppResourcesAssemblyBuilder.cs
index 3ea9063ee57a31d131df447cfb1ec314dcf7107c..20d50a1767ad0f69b0665009200960fb6b7c5785 100644 (file)
@@ -114,20 +114,27 @@ namespace System.Web.Compilation
                                cp.EmbeddedResources.Add (f);
                        
                        CompilerResults results = abuilder.BuildAssembly (cp);
+                       if (results == null)
+                               return;
+                       
                        Assembly ret = null;
                        
                        if (results.NativeCompilerReturnValue == 0) {
                                ret = results.CompiledAssembly;
-                               BuildManager.TopLevelAssemblies.Add (ret);
-                               if (defaultAssembly)
+                               if (defaultAssembly) {
+                                       BuildManager.TopLevelAssemblies.Add (ret);
                                        mainAssembly = ret;
+                               }
                        } else {
                                if (HttpContext.Current.IsCustomErrorEnabled)
                                        throw new ApplicationException ("An error occurred while compiling global resources.");
                                throw new CompilationException (null, results.Errors, null);
                        }
-                       HttpRuntime.WritePreservationFile (ret, canonicAssemblyName);
-                       HttpRuntime.EnableAssemblyMapping (true);
+                       
+                       if (defaultAssembly) {
+                               HttpRuntime.WritePreservationFile (ret, canonicAssemblyName);
+                               HttpRuntime.EnableAssemblyMapping (true);
+                       }
                }
 
                string BuildAssemblyPath (string cultureName, AssemblyBuilder abuilder)
@@ -137,7 +144,7 @@ namespace System.Web.Compilation
                                Directory.CreateDirectory (baseDir);
                        
                        string baseFileName = Path.GetFileNameWithoutExtension (baseAssemblyPath);
-                       string fileName = String.Format ("{0}.resources.dll", baseFileName);
+                       string fileName = String.Concat (baseFileName, ".resources.dll");
                        fileName = Path.Combine (baseDir, fileName);
 
                        CodeCompileUnit assemblyInfo = GenerateAssemblyInfo (cultureName);