I can start Mathematica from C#, but the CubeOfCubes.nb argument cannot be found (The file “CubeOfCubes.nb” could not be found.).
private void BtnKubus_Click(object sender, RoutedEventArgs e)
{
Process P = new Process();
P.StartInfo.FileName = "C:\\Programme/Wolfram Research/Mathematica/12.2/Mathematica.exe/";
P.StartInfo.Arguments = "CubeOfCubes.nb";
P.Start();
CubeOfCubes.nb is in the same directory as Mathematica.exe. How do I have to proceed?
Usually not a good idea to drop files into an applications installation directory. Anyway, have you tried using the full path?
P.StartInfo.Arguments = "C:\\Programme/Wolfram Research/Mathematica/12.2/CubeOfCubes.nb";
Finally, the notebook file should be integrated into the project. But as an argument in the same directory as Mathematica.exe it should work for now. Unfortunately not - not even with the full file path.
The solution is simple:
private void BtnMandelbrot_Click(object sender, RoutedEventArgs e)
{
const string program = "C:\\Programme/Wolfram Research/Mathematica/12.2/Mathematica.exe/";
const string argument = "C:\\Projects/NB/Mandelbrot.nb";
Process.Start(program, argument);
}