Fixed ambiguous build error
diff --git a/templates/standalone/cordova/lib/build.js b/templates/standalone/cordova/lib/build.js
index 9986a7e..1375c54 100644
--- a/templates/standalone/cordova/lib/build.js
+++ b/templates/standalone/cordova/lib/build.js
@@ -85,14 +85,27 @@
     return false;
 }
 
+function get_solution_name(path) {
+    if (fso.FolderExists(path)) {
+        var proj_folder = fso.GetFolder(path);
+        var proj_files = new Enumerator(proj_folder.Files);
+        for (;!proj_files.atEnd(); proj_files.moveNext()) {
+            if (fso.GetExtensionName(proj_files.item()) == 'sln') {
+                return proj_files.item();
+            }
+        }
+    }
+    return null;
+}
+
 // builds the project and .xap in release mode
 function build_xap_release(path) {
-    Log("Building Cordova-WP8 Project:");
+    Log("Building Cordova-WP7 Project:");
     Log("\tConfiguration : Release");
     Log("\tDirectory : " + path);
     
     wscript_shell.CurrentDirectory = path;
-    exec_verbose('msbuild /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Release');
+    exec_verbose('msbuild ' + get_solution_name(path) + ' /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Release');
     
     // check if file xap was created
     if (fso.FolderExists(path + '\\Bin\\Release')) {
@@ -105,18 +118,18 @@
             }
         }
     }
-    Log('ERROR: MSBuild failed to create .xap when building cordova-wp8 for release.', true);
+    Log('ERROR: MSBuild failed to create .xap when building cordova-wp7 for release.', true);
     WScript.Quit(2);
 }
 
 // builds the project and .xap in debug mode
 function build_xap_debug(path) {
-    Log("Building Cordova-WP8 Project:");
+    Log("Building Cordova-WP7 Project:");
     Log("\tConfiguration : Debug");
     Log("\tDirectory : " + path);
     
     wscript_shell.CurrentDirectory = path;
-    exec_verbose('msbuild /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Debug');
+    exec_verbose('msbuild ' + get_solution_name(path) + ' /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Debug');
     
     // check if file xap was created
     if (fso.FolderExists(path + '\\Bin\\Debug')) {
@@ -129,7 +142,7 @@
             }
         }
     }
-    Log('ERROR: MSBuild failed to create .xap when building cordova-wp8 for debugging.', true);
+    Log('ERROR: MSBuild failed to create .xap when building cordova-wp7 for debugging.', true);
     WScript.Quit(2);
 }