How to open a exe. file using c# [duplicate]
Starting a process by specifying its file name is similar to typing the information in the Run dialog box of the Windows Start menu. Therefore, the file name does not need to represent an executable file. It can be of any file type for which the extension has been associated with an application installed on the system.
1 1 1 silver badge
answered Jun 20, 2013 at 7:01
Jonathon Reinhart Jonathon Reinhart
134k 34 34 gold badges 259 259 silver badges 332 332 bronze badges
+1 for being the fastest gun.
Jun 20, 2013 at 7:27
Process.Start(«notepadd.exe»).WaitForExit(); // if you want to block the caller .
Jul 3, 2014 at 10:14
You can use Process.Start method like;
Starts a process resource and associates it with a Process component.
Process.Start("calc.exe"); Process.Start("notepad.exe");
Starting a process by specifying its file name is similar to typing the information in the Run dialog box of the Windows Start menu. Therefore, the file name does not need to represent an executable file. It can be of any file type for which the extension has been associated with an application installed on the system. For example the file name can have a .txt extension if you have associated text files with an editor, such as Notepad, or it can have a .doc if you have associated.doc files with a word processing tool, such as Microsoft Word. Similarly, in the same way that the Run dialog box can accept an executable file name with or without the .exe extension, the .exe extension is optional in the fileName parameter. For example, you can set the fileName parameter to either «Notepad.exe» or «Notepad».
How do I run an EXE file in Visual Studio?
In Visual Studio, select File > Open > Project. In the Open Project dialog box, select All Project Files, if not already selected, in the dropdown next to File name. Navigate to the .exe file, select it, and select Open.
How do I run a program in Visual Studio?
Build and run your code in Visual Studio
- To build your project, choose Build Solution from the Build menu. The Output window shows the results of the build process.
- To run the code, on the menu bar, choose Debug, Start without debugging. A console window opens and then runs your app.
How do I run a .exe code?
Where is the EXE file for Visual Studio?
Here are their executables. They are all located in the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE directory. Please type devenv command from in the run program, it will launch installed visual studio.
Can EXE files be edited?
An EXE is not a text file and is not intended to be edited. It can be modified with a Hex editor but you need considerable knowledge to do so.
Can I use Visual Studio for C?
Yes, you very well can learn C using Visual Studio. Visual Studio comes with its own C compiler, which is actually the C++ compiler. Just use the . c file extension to save your source code.
How do I run an exe from command line arguments?
option. You can test command line arguments by running an executable from the “Command Prompt” in Windows or from the “DOS prompt” in older versions of Windows. You can also use command line arguments in program shortcuts, or when running an application by using Start -> Run.
How do I run an exe file on Windows 10?
Methods to Open . EXE Files in Windows 10
- Press Window + R on your system and type cmd to launch Command prompt.
- On the command prompt, type regedit and press enter.
- Registry Editor will appear on the screen, in the left pane, click HKEY_CLASSES_ROOT.exe.
- In the right pane, you’ll see Registry keys.
How to open any exe file in Visual Studio?
In Visual Studio you can open any EXE as a ‘project’. Just go to File->Open->Project/Solution and browse to the .exe file. Like you would if it was a .sln file.
Where do I find executable project in Visual Studio?
You need to BUILD your project. This will produce an EXECUTABLE (The.EXE file you mentioned), assuming you created the project with the correct type. Right click on your solution in Solution Explorer in VIsual Studio and select Build. Go to the bin folder under your project folder and look for the EXE.
Where are the application files in Visual Studio?
But instead of using the produced installer, find the produced files (the EXE file and the .config, .manifest, and .application files, along with any DLL files, etc.) – they are all in the same folder and typically in the bin\Debug folder below the project file ( .csproj ).
Where is the.exe file in vs 2019?
In VS 2019 when I build a release version, all I see in the Release folder are a .dll and a few other files. Where is the .EXE? Additional info: this is a C# console app I’m trying to build. Getting a dynamic library as output means that you used one of the .NET core project types.
Как из готового проекта сделать екзешник?
У меня есть готовый проект с консольным приложением. Это мое первое простейшие консольное приложение. Как мне в Visual Studio 2013 сделать его .exe файлом?
- Вопрос задан более трёх лет назад
- 1348 просмотров
Комментировать
Решения вопроса 1

Проект -> Построение -> Построить решение ИЛИ Сборка -> Собрать решение (F7).
Откроется окно вывода. В нём будет что-то вроде этого:
—— Сборка начата: проект: * название вашего решения *, Конфигурация: Debug Any CPU ——
* название вашего решения * -> [ путь к скомпилированному проекту]
========== Сборка: успешно: 1, с ошибками: 0, без изменений: 0, пропущено: 0 ==========
Следите за тем, какую версию .NET Framework используете (в разделе References в обозревателе решений). Чем новее версия, тем меньше вероятности, что она будет установлена на какой-нибудь старенький ПК, и, соответственно, ваша программа не запустится на нём.
Как отлаживать и профилировать любой EXE-файл с помощью Visual Studio
Вам когда-нибудь нужно было отлаживать или профилировать исполняемый файл (файл .exe), для которого у вас нет исходного кода или вы не можете его собрать? Тогда наименее известный тип проекта Visual Studio, проект EXE, для вас!
В Visual Studio вы можете открыть любой EXE-файл как «проект». Просто перейдите в Файл -> Открыть -> Проект/Решение и перейдите к файлу .exe . Как если бы это был файл .sln . Visual Studio откроет этот EXE-файл как проект. Эта функция существует уже давно. Она работает на всех поддерживаемых в настоящее время версиях Visual Studio, и документация по ней находится на странице Отладка приложения, которое не является частью решения Visual Studio.
Отладка
Как и в обычном проекте, вы можете начать отладку с помощью F5, которая запустит EXE и подключит отладчик. Если вы хотите отладить запуск, вы можете запустить с помощью F11, который запустит EXE и остановится на первой строке пользовательского кода. Оба эти параметра доступны в контекстном меню для проекта EXE в окне Solution Explorer, как показано ниже:

Для отладки понадобятся символы, файлы PDB, для EXE и любых DLL, которые нужно отладить. Visual Studio будет следовать тому же процессу и попытается получить символы также, как и при отладке обычного проекта. Поскольку маловероятно, что файлы PDB были распространены вместе с EXE-файлом, возможно, вы захотите найти их в сборке или, что еще лучше, на сервере символов. Дополнительную информацию и рекомендации по использованию символов можно найти в этом блоге.
Для эффективной отладки вам также понадобится исходный код, который использовался для сборки EXE, или даже для нескольких файлов, которые вас интересуют. Вам нужно найти эти файлы и открыть их в Visual Studio. Если исходный код не совпадает с исходным кодом, который был собран, EXE Visual Studio предупредит вас, когда вы попытаетесь вставить точку останова, и точка останова не будет привязана. Это поведение может быть изменено в окне Settings peek window. В окне просмотра параметров щелкните текст ссылки Must match source, а затем установите флажок, чтобы разрешить несоответствующий источник, как показано ниже. Конечно, с несоответствующим источником вы никогда не знаете, что произойдет, так что используйте это только на свой страх и риск.
Если EXE был собран с SourceLink, то информация об источнике будет включена в PDB, и Visual Studio попытается загрузить источник автоматически. Это действительно хорошая причина использовать SourceLink с вашими проектами. Даже если у вас есть локальный набор, у вас может не быть той версии, которая использовалась для сборки двоичного файла. SourceLink — ваш надежный способ убедиться, что правильный источник связан с правильным двоичным файлом.
Если вы не можете получить исходный код, у вас еще есть несколько вариантов:
- Используйте инструмент для декомпиляции сборок обратно в C#, который вы можете перекомпилировать в новую сборку, чтобы исправить старую.
- ILSpy — отличный выбор для этого, но есть и множество других хороших платных и бесплатных инструментов.
- Документ Source Not Found содержит ссылку на view disassembly. Имейте в виду, что если вы привыкли к отладке кода на C#, представление о разборке (view disassembly) является крайним средством.

Профилирование
Вы также можете использовать инструменты профилирования с EXE-файлом, запустив их из Отладка -> Профилирование производительности. На странице запуска инструментов профилирования вы можете выбрать, какие инструменты использовать против EXE. Дополнительную информацию о профилировании можно найти в этих документах ( https://docs.microsoft.com/en-us/visualstudio/profiling/profiling-feature-tour?view=vs-2019).
Заключение
Вот и все. Краткий обзор того, как вы можете использовать Visual Studio для отладки и профилирования приложений, которые вы не создаете и которые могут даже не иметь исходного кода. В следующий раз, когда вам понадобится отладить или профилировать EXE-файл, не забудьте, что вы можете открыть его как решение в Visual Studio!
- Блог компании Microsoft
- Visual Studio