调试在Visual Studio中接受命令行参数的Windows Forms应用程序 [英] Debugging Windows Forms application that accepts command line arguments in Visual Studio

查看:71
本文介绍了调试在Visual Studio中接受命令行参数的Windows Forms应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows窗体中创建了该应用程序,该应用程序检查是否包含特定的命令行参数并采取相应的措施.

I created the application in Windows Forms that checks, if it contains specific command line arguments and acts accordingly.

现在,我想使用不同的命令行参数来测试/调试代码.

Now I would like to test/debug my code with different command lines arguments.

我通过单击项目并选择属性/调试"来输入命令行参数.但是,当我开始调试时,会收到以下消息

I entered command line arguments by clicking on my project and choosing Properties/Debug. But when I start the debugging, I receive following message

当前项目设置指定将使用特定的安全权限来调试项目.在这种模式下,命令行参数将不会传递给可执行文件.

The current project settings specify that the project will be debugged with specific security permissions. In this mode, command line arguments will not be passed to the executable.

在属性/安全"中,选择了"这是完全信任的应用程序" ,所以我不确定为什么会抱怨.

In Properties/Security, "This is full trust application" is selected, so I am not sure why it is complaining.

推荐答案

您已经为此项目设置了ClickOnce发布,它添加了安全限制,以防止处理命令行参数.

You have setup ClickOnce publishing for this project, which adds a security restriction preventing command line parameters from being processed.

要删除安全限制,请执行以下操作:

To remove the security restriction:

  • 打开项目属性
  • 转到安全标签
  • 取消选中启用ClickOnce安全设置"

这篇关于调试在Visual Studio中接受命令行参数的Windows Forms应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆