Merge pull request #901 from Blewzman/FixAggregateExceptionGetBaseException
[mono.git] / mcs / class / Microsoft.Build.Tasks / Microsoft.Build.Tasks / GenerateResource.cs
index 60dd7a68c4b8a83e0954d93d797ee53ffedb4947..8abdad3b7f7f76c0fa61469ae8074bb9487ee1e0 100644 (file)
@@ -376,7 +376,9 @@ namespace Microsoft.Build.Tasks {
 
                protected override string GenerateFullPathToTool ()
                {
-                       return Path.Combine (ToolPath, ToolExe);
+                       if (!string.IsNullOrEmpty (ToolPath))
+                               return Path.Combine (ToolPath, ToolExe);
+                       return ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
                }
 
                protected override MessageImportance StandardOutputLoggingImportance {
@@ -384,7 +386,7 @@ namespace Microsoft.Build.Tasks {
                }
 
                protected override string ToolName {
-                       get { return MSBuildUtils.RunningOnWindows ? "resgen2.bat" : "resgen2"; }
+                       get { return "resgen.exe"; }
                }
 
                public string SourceFile { get; set; }