diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetCLI.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetCLI.cs index e020fc89e85..f33cc4d9c45 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetCLI.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetCLI.cs @@ -154,10 +154,10 @@ List GetDefaultCommandLineArgs (string verb, string target = null, strin arguments.Add ($"/t:{target}"); } if (Directory.Exists (AndroidSdkPath)) { - arguments.Add ($"/p:AndroidSdkDirectory=\"{AndroidSdkPath}\""); + arguments.Add ($"/p:AndroidSdkDirectory=\"{AndroidSdkPath.TrimEnd('\\')}\""); } if (Directory.Exists (JavaSdkPath)) { - arguments.Add ($"/p:JavaSdkDirectory=\"{JavaSdkPath}\""); + arguments.Add ($"/p:JavaSdkDirectory=\"{JavaSdkPath.TrimEnd ('\\')}\""); } if (parameters != null) { foreach (var parameter in parameters) {