0

I have a MVC project inside VS 2015. I would like to run phantomjs.exe, which is saved in bin directory. This same code works fine inside windows application. It doesn't work inside MVC app (as said, my MVC app runs inside IIS express). Nothing happens, no exception, nothing. If I try to call methods on driver, they are not working. And also, console window is not showing when phantomjs.exe is being called. I've granted permissions to 'Everyone' - full control on that .exe.

PhantomJSOptions options = new PhantomJSOptions();
PhantomJSDriver driver = new PhantomJSDriver(options); //at that point, console window should open, but nothing happens

Does anyone has experience of running executables from MVC application?

FrenkyB
  • 6,625
  • 14
  • 67
  • 114
  • This embedded resource-based approach may help: https://stackoverflow.com/questions/15470090/run-exe-file-as-an-embedded-resource-in-c-sharp. EXE files intended to use in server-side, so that no console will shown in client machine. – Tetsuya Yamamoto Aug 31 '17 at 08:23
  • Possible duplicate of [Need to execute *.exe in server from ASP.net](https://stackoverflow.com/q/13658555/11683) – GSerg Aug 31 '17 at 08:24
  • You do understand that executables started from ASP.NET run on the server, not on the client? – CodeCaster Aug 31 '17 at 08:25
  • 1
    I understand this (I need that exe on the server, for server side processing). Why? – FrenkyB Aug 31 '17 at 08:26

1 Answers1

0

When you call a EXE on your windows server you are calling the exe from the user explained in this user What are all the user accounts for IIS/ASP.NET and how do they differ?

you can simply put exe in your bin and upload it on the server. call the exe through the code and it will be called from the asp.net account.

someone suggested embedded resource approach. for following that approach you can try this https://stackoverflow.com/a/15470314/713789

Anirudha Gupta
  • 9,073
  • 9
  • 54
  • 79