Does anyone have an idea of how I would be able to get and store(string) the path to my solution directory in an xUnit Project?
Environment.CurrentDirectory works fine for what i need
This works all the time
using System.IO; // needed for Path
using System.Reflection; // needed for Assembly
var path = new Uri(Assembly.GetExecutingAssembly().GetName().CodeBase).LocalPath
var directoryPath = Path.GetDirectoryName(path)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With