0

I have a javascript code (business logic) runs on client side, i want the same logic to execute from windows service (C# code), instead of re-writing those complex javascript code to C#, is there any way to execute it from C# class itself. Because i want to run this code inside windows service

3
  • Do you want to simulate a web browser and run your JavaScript on it? If yes, the Selenium framework might be a good choice Commented Aug 4, 2016 at 16:58
  • No, for example, in javascript i have a different functions which takes the Json data and does lots of business validation and extracts result out of it and dumps into database using REST service, i need the same logig to extract result from json input to run on windows service(scheduled one). Moving this javascript logic to C# will take lots of time and effort for testing. so i'm thinking any is there quick way without re-writing those code in C#, just execute and store the result in db Commented Aug 4, 2016 at 17:05
  • rushfrisby.com/which-net-javascript-engine-is-the-fastest or stackoverflow.com/questions/172753/… may be a starting point... Note that if your JavaScript was not written to run without browser rewriting code in C# may be faster option... Commented Aug 4, 2016 at 17:13

1 Answer 1

2

In theory, yes, you can. MicroSoft has released the JS engine behind the Edge browser - Chakra. You can find it on GitHub.

Sign up to request clarification or add additional context in comments.

1 Comment

@AlexeiLevenkov: "write one from scratch" - what do you mean? It is already written and you can execute scripts directly...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.