I'm trying to get some automated UI tests set up for a WPF application I'm working on in order to exercise the UI but I can't seem to get the app to run even using an explicit path. Because these tests need to run on any machine including our build server, it needs to be a relative path so it can run anywhere. I've looked at a few different questions, C# Application.ExecutablePath on WPF Framework 3.5 and Getting the application's directory from a WPF application for examle, and neither of those worked.
Here's an example of what my project structure looks like
Solution
AccepatanceTestProject
UITest.cs
MainApp
MainApp
Bin
Debug
MainApp.Exe
I'm trying to access the MainApp.exe in MainApp\Bin\Debug\MainApp.exe from AcceptanceTestProject\UITest.cs
System.Reflection.Assembly.GetEntryAssembly().Location seems to be the most suggested option, but this returns the path to the UITest.cs executable directory. Any advice would be greatly appreciated. Thanks!