我想在 Visual Studio 2008 中调试一个程序。问题是如果它没有获取参数,它就会退出。这是来自主要方法:
if (args == null || args.Length != 2 || args[0].ToUpper().Trim() != "RM")
{
Console.WriteLine("RM must be executed by the RSM.");
Console.WriteLine("Press any key to exit program...");
Console.Read();
Environment.Exit(-1);
}
我不想在编译时将其注释掉然后再返回。调试时如何使用参数启动程序?它被设置为启动项目。
最佳答案
转到 Project-><Projectname> Properties
.然后点击Debug
选项卡,并在名为 Command line arguments
的文本框中填写您的参数.
关于c# - 调试时如何启动带有参数的程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4791140/