第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何同時支持 UWP 命令行和 UWP UI?

如何同時支持 UWP 命令行和 UWP UI?

C#
慕碼人8056858 2021-07-09 18:15:52
我當前的應用程序如下所示:public static class Program{    //Default code-gen unless we include DISABLE_XAML_GENERATED_MAIN in the build properties.    static void Main(string[] args)    {        IActivatedEventArgs activatedArgs = AppInstance.GetActivatedEventArgs();        if(ActivationKind.CommandLineLaunch.Equals(activatedArgs?.Kind))        {            CommandLineActivatedEventArgs cmdLineArgs = activatedArgs as CommandLineActivatedEventArgs;            CommandLineActivationOperation operation = cmdLineArgs.Operation;            string activationPath = operation.CurrentDirectoryPath;            System.Console.WriteLine("foo");        }        else        {            global::Windows.UI.Xaml.Application.Start((p) => new App());        }    }}我的清單:    <Application Id="App" Executable="$targetnametoken$.exe" desktop4:SupportsMultipleInstances="true">    <uap5:Extension Category="windows.appExecutionAlias" [...]根據(jù)用戶是從命令提示符還是從開始菜單啟動應用程序,UI 將如圖所示顯示。但是當用戶從 cmd 啟動應用程序時,不會顯示 Console.WriteLine("foo") 的輸出。因此,我添加了desktop4:Subsystem="console".This 導致控制臺窗口被啟動,無論用戶是從 startmneu 還是命令行啟動應用程序。如何確保僅通過從命令提示符開始顯示控制臺窗口?我是否必須創(chuàng)建第二個 uwp 項目?
查看完整描述

1 回答

?
白衣染霜花

TA貢獻1796條經驗 獲得超10個贊

UWP 控制臺應用程序還有許多其他注意事項。例如只有 C++ /WinRT 和 C++ /CX UWP 應用程序可能是控制臺應用程序。并且它必須以桌面或物聯(lián)網項目為目標。形成您的代碼,我可以確定它是 UWP 應用程序。而且即使是 UWP 應用程序,也無法在UIConsole兩種模型中啟動它。因為,它可能不會創(chuàng)建窗口。


查看完整回答
反對 回復 2021-07-18
  • 1 回答
  • 0 關注
  • 260 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號