From 3f6027483bd4cc9a8ee84e8ab495d5204cb7bb08 Mon Sep 17 00:00:00 2001 From: Tal Zaccai Date: Wed, 12 Dec 2018 11:01:07 -0800 Subject: [PATCH] AmbrosiaCS to look for Ambrosia.csproj in bin path instead of dependencies dir --- Clients/CSharp/AmbrosiaCS/Program.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Clients/CSharp/AmbrosiaCS/Program.cs b/Clients/CSharp/AmbrosiaCS/Program.cs index 2b08c5e..27469d0 100644 --- a/Clients/CSharp/AmbrosiaCS/Program.cs +++ b/Clients/CSharp/AmbrosiaCS/Program.cs @@ -159,7 +159,12 @@ namespace Ambrosia var conditionToPackageInfo = new Dictionary>>(); - var projFile = Path.Combine(_binPath, $@"{Assembly.GetExecutingAssembly().GetName().Name}.csproj"); + var execAssembly = Assembly.GetExecutingAssembly(); + var projFile = Path.Combine(Path.GetDirectoryName(execAssembly.Location), $@"{execAssembly.GetName().Name}.csproj"); + if (!File.Exists(projFile)) + { + throw new Exception($"Unable to find {Path.GetFileName(projFile)} in bin path: {Path.GetDirectoryName(projFile)}"); + } var doc = XDocument.Load(projFile); foreach (var itemGroup in doc.Descendants("ItemGroup"))