question

6666666 avatar image
0 Votes"
6666666 asked DuaneArnold-0443 commented

How to call method in c++ using asp.net core?

I am using asp.net core web api and want to call c++ method on the same server how to do it?

the c++ method is individual running in a exe file or in a service can it be done?

c++dotnet-aspnet-core-general
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I am not want to call a method in dll I just want to call method which is running

0 Votes 0 ·

1 Answer

JerryCai-MSFT avatar image
0 Votes"
JerryCai-MSFT answered DuaneArnold-0443 commented

Hi,65841535

To call a C++ exe in a .net core project, you can try to use Process class, related tutorial here:

system.diagnostics.process

It can provide access to local and remote processes and enables you to start and stop local system processes.

Best Regards,
Jerry Cai


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you @JerryCai-MSFT but I do not want to start a process.


what I want is to run a method in a exe which is already running.

0 Votes 0 ·

Yes, you can run an exe from ASP.NET Core program, but to run a method, the exe would have to be modified to accept a parameter to know to execute the method.

https://codeburst.io/run-an-external-executable-in-asp-net-core-5c2f8b6cacd9

0 Votes 0 ·