0

I've just started a PoC on service fabric for a project and I'm stuck on something that should have been straightforward but has become a real pain ...

What I need to do is host a console app returning some values in the service fabric and be able to call it on demand and get back its return value.

So I've created a simple exe looking like this, hosted in a GuestExe

    static void Main(string[] args)
    {
        Console.WriteLine("123");
        File.AppendAllText("hello.txt" + DateTime.Now.ToString(), "Hello world!");
        //Console.ReadLine();
    }

First, if the readline is commented, the explorer shows the guestExe as failing and the file is not created. If I uncomment it, the guest exe will appear as being good in the explorer, and the console app will be started on it's own (despite I didn't ask for it), the file will be created, and I won't be able to call it.

cluster image

I've tried to just hit few things in my browser : the endpoint above, http://localhost:19081/PoC9/GuestExe?cmd=instance and same without the cmd argument.

If anyone has any idea of how that should be done, please help :)

Xav Sc
  • 489
  • 1
  • 5
  • 23
  • Could you explain what you are trying to achieve, it sounds like you might have better luck with a different approach. – Esben Bach Oct 07 '17 at 07:07
  • Hey, thanks for the reply, I thought the only approach to handle executables in service fabric was through guest exes, but I've tried afterwards to launch it with Process and it works just fine, so I'll just make a service handling exes (not sure yet if it has to be stateless or stateful one) and make it scale as necessary – Xav Sc Oct 08 '17 at 10:41

0 Answers0