调试 dot net 应用程序时如何传递参数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/637410/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to pass arguments when debugging a dot net application
提问by Omar Abid
I have an command line that uses arguments, I have no problem with this, but each time I want to test the application, I need to compile it, run the CMD, call the application with the parameters from the CMD, because I didn't find any solution that let me dynamically pass arguments to the console in Visual Studio Any idea about that? Thanks a lot!!
我有一个使用参数的命令行,我对此没有问题,但是每次我想测试应用程序时,我都需要编译它,运行 CMD,使用 CMD 中的参数调用应用程序,因为我没有找不到任何可以让我在 Visual Studio 中将参数动态传递给控制台的解决方案 对此有任何想法吗?非常感谢!!
回答by Mitch Wheat
Goto Project->Propertiesand click the DebugTab.
转到Project->Properties并单击Debug选项卡。
There is a section for command line arguments:
有一个命令行参数部分:


回答by Andy White
Right click your project in VS -> Properties -> Debug tab
在 VS 中右键单击您的项目 -> 属性 -> 调试选项卡
There is an area where you can specify command line arguments. When you debug your project, VS will start it up with these args.
有一个区域可以指定命令行参数。当您调试项目时,VS 将使用这些参数启动它。
回答by scott
Go to the project properties - Debug section, and under the Start Options heading there is a section for Command line arguments.
转到项目属性 - 调试部分,在开始选项标题下有一个命令行参数部分。

