如何通过commuments从命令行运行winui3应用

发布于 2025-01-28 11:31:59 字数 418 浏览 0 评论 0原文

我构建了一个这样的应用程序:

protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
    {
      string[] cmdargs = Environment.GetCommandLineArgs();
      ... Map arguments to variables ...
      ... Do stuff ...
    }

我正在使用框架依赖性限制发布而无需单击。

我用一个包含两个CMD ARG的调试配置文件测试了该应用程序,并且可以很好地工作。但是,如果我试图使用myApp.exe arg1 arg2执行它,则该应用程序开始在CMD内部,但看起来像什么都没做。

也许我错过了什么?

I build an app like that one:

protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
    {
      string[] cmdargs = Environment.GetCommandLineArgs();
      ... Map arguments to variables ...
      ... Do stuff ...
    }

I'm using the framework dependend publishing without Click-Once.

I tested that app with a debug profile that contains two cmd args and it works perfectly. But if i'm trying to execute it with MyApp.exe arg1 arg2, the app starts inside the cmd but it looks, like it doesn't do anything.

Maybe i missed anything?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文