Debugging with command-line parameters in Visual S

2019-01-01 01:36发布

I'm developing a C++ command-line application in Visual Studio and need to debug it with command-line arguments. At the moment I just run the generated EXE file with the arguments I need (like this program.exe -file.txt) , but this way I can't debug. Is there somewhere I can specify the arguments for debugging?

8条回答
几人难应
2楼-- · 2019-01-01 02:15

Even if you do start the executable outside Visual Studio, you can still use the "Attach" command to connect Visual Studio to your already-running executable. This can be useful e.g. when your application is run as a plug-in within another application.

查看更多
冷夜・残月
3楼-- · 2019-01-01 02:24

In Visual Studio 2017 with .net core console application do the following:

Right click on the Project in Solution window, select "Properties" then Debug (on the left side), enter the arguments into the field "Application Arguments".

Note that they should be space separated.

查看更多
登录 后发表回答