diff --git a/tools/mmp/driver.cs b/tools/mmp/driver.cs index 25d4b7106c14..9342d76afaba 100644 --- a/tools/mmp/driver.cs +++ b/tools/mmp/driver.cs @@ -807,12 +807,21 @@ static string GetRealPath (string path) static string GetXamMacPrefix () { - var path = System.Reflection.Assembly.GetExecutingAssembly ().Location; - var envFrameworkPath = Environment.GetEnvironmentVariable ("XAMMAC_FRAMEWORK_PATH"); if (!String.IsNullOrEmpty (envFrameworkPath) && Directory.Exists (envFrameworkPath)) return envFrameworkPath; + var path = System.Reflection.Assembly.GetExecutingAssembly ().Location; + +#if DEBUG + var localPath = Path.GetDirectoryName (path); + while (localPath.Length > 1) { + if (Directory.Exists (Path.Combine (localPath, "_mac-build"))) + return Path.Combine (localPath, "_mac-build", "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current"); + localPath = Path.GetDirectoryName (localPath); + } +#endif + path = GetRealPath (path); return Path.GetDirectoryName (Path.GetDirectoryName (Path.GetDirectoryName (path))); } diff --git a/tools/mmp/mmp.csproj b/tools/mmp/mmp.csproj index 42d45ea72440..600c5c7324c4 100644 --- a/tools/mmp/mmp.csproj +++ b/tools/mmp/mmp.csproj @@ -15,7 +15,7 @@ full False bin\Debug - MONOMAC;MMP + MONOMAC;MMP;DEBUG prompt 4 AnyCPU