Can I add external .exe to my C# project so that i don't need any path to access it as outside app? I want to embed it as my project resource? Thanks in advance
How to add External .exe to my C# project?
Asked Answered
You can add file by right-clicking on the project, or drag-n-drop works.
You can add your exe in your solution and set its Build Action: Content
and Copy to output Directory: Copy always
.
The installer should automatically include the file.
Hope this helps
Could you explain the steps. I am not very experienced in C#. Thanks in advance. –
Hampstead
It is more Visual Studio than c# here.... drag and drop the exe you have from a windows explorer into your Solution manager to add the exe to the project. –
Boxer
then click on the exe that has just been added in the solution explorer window and open up the Properties tab, in here you have two options 1) Build action and 2) Copy to Output Directory. These are the fields you want to set as in my answer and that should do it –
Boxer
© 2022 - 2024 — McMap. All rights reserved.
Process.Start
it, or use one of the concepts presented here, a bit easier for managed code, a bit heavy lifting for PE code. If it has dependencies, it will be a whole different story and won't work without an installer. – Painter