[build] Roslyn switch
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / Csc.cs
index 06b04b2670caab0922c550dc1946059571470c88..d6e3ff6a434d50efe5992af8122d2efd3018ddde 100644 (file)
@@ -41,10 +41,6 @@ namespace Microsoft.Build.Tasks {
 
                protected internal override void AddResponseFileCommands (CommandLineBuilderExtension commandLine)
                {
-#if !NET_4_0
-                       //pre-MSBuild 2 targets don't support multi-targeting, so tell compiler to use 2.0 corlib
-                       commandLine.AppendSwitch ("/sdk:2");
-#endif
                        base.AddResponseFileCommands (commandLine);
 
                        if (AdditionalLibPaths != null && AdditionalLibPaths.Length > 0)
@@ -148,7 +144,11 @@ namespace Microsoft.Build.Tasks {
                {
                        if (!string.IsNullOrEmpty (ToolPath))
                                return Path.Combine (ToolPath, ToolExe);
-                       return ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
+                       var possibleToolPath = ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
+                       if (!string.IsNullOrEmpty(possibleToolPath))
+                               return  possibleToolPath;
+
+                       return ToolLocationHelper.GetPathToDotNetFrameworkBinFile(ToolExe);
                }
 
                [MonoTODO]
@@ -219,7 +219,7 @@ namespace Microsoft.Build.Tasks {
 
                protected override string ToolName {
                        get {
-                               return "mcs.exe";
+                               return MSBuildUtils.RunningOnWindows ? "csc.bat" : "csc.exe";
                        }
                }