I have a .net core console application named ShowDate.
using System;
namespace ShowDate
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(DateTime.Now);
}
}
}
After building I get ShowDate.dll rather than ShowDate.exe. I have tested it via terminal
dotnet ShowDate.dll
and it produces date time without problem.
Now I create a second .net core console application as follows.
namespace InvokingShowDate
{
class Program
{
static void Main(string[] args)
{
Process p = new Process();
p.StartInfo.FileName = "dotnet";
p.StartInfo.Arguments = "ShowDate.dll";
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = false;
p.Start();
p.WaitForExit();
}
}
}
and it fails to run with the following error.
Question
What is wrong? How to solve it?
Edit:
Of course I have copied the ShowDate.dll and pasted it into the output folder of the second project.

ShowDate.dllandShowDate.runtimeconfigare available for the second console app.