I have a .NET Framework project that requires running a built console application from a .NET Core project in the same solution.
Take the example file structure:
Test/bin/Debug/Test.exe
Service/bin/Debug/netcoreapp2.2/Service.dll
The current approach involves starting a new process, similar to the following:
dotnet run ../../../Service/bin/Debug/netcoreapp2.2/Service.dll
I am fairly new to .NET, and so unsure if the following ideas are possible:
- Modifying the path when running the Test application so that I can start the Service process with
dotnet run Service.dll
. - Getting the Test project to copy the Service build files into the Test build folder.
For bonus points, if/when the Framework project is upgraded to Core, is it possible to start a Core application process by using
it in another application?
Edit:
For clarification, I'm hoping to avoid using that hard-coded relative path to build output folder, since it changes between Framework and Core and different versions of Core. My hope is to find a built-in variable or functionality to get the build location of another project (even if I need to hard-code the Debug/Release part).
For example (excuse the pseudocode):
using Service;
var path = getPathToDebugBuildFolder(Service);
startProcess(Path.Join(path, "Service.dll"));