Running .NET core app (.dll) with cmd using process.start

I'm new to .NET Core 2.0, so I could do it all wrong, if so, let me know.

I have a .NET core 2.0 application that should be cross-platform, so the application is a .dll console application and it works fine on all platforms.

I am trying to implement a kind of watchdog that, if necessary, will duplicate itself, and in the same way it was called

> $ dotnet process.dll

My code is:

var process = new Process
{
   StartInfo = new ProcessStartInfo
   {
       FileName = "dotnet",
       Arguments = "path\release\PublishOutput\proces.dll"
       UseShellExecute = true,
       RedirectStandardOutput = false,
       RedirectStandardError = false,
       CreateNoWindow = true
     }

 };

 process.Start();

The problem is that when the process runs this code, I get the following exception

: System.IO.FileNotFoundException: "System.Runtime, Version = 4.2.0.0, Culture = neutral, PublicKeyToken = sometoken" . .

dotnet , , ?

? .NET ?

+4
1

, WorkDirectory path\release\PublishOutput\, , , dotnet process.dll

+5

Source: https://habr.com/ru/post/1689364/


All Articles