在我的应用程序中,每当出现任何未处理的异常时,我都想显示一个消息对话框。但是在抛出未处理的异常时似乎没有出现对话框消息,显示消息弹出窗口是否有效?同样在 MSDN 文档中,我没有找到太多信息。
以下是我正在使用的测试代码:
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
this.UnhandledException += App_UnhandledException;
}
private async void App_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
MessageDialog dialog = new MessageDialog("Unhandled Execption", "Exception");
await dialog.ShowAsync();
}
Run Code Online (Sandbox Code Playgroud) 我正在寻找可以获取 UWP 应用程序中的串行端口列表的 API。由于 System.IO.Ports 不适用于 UWP,您能否建议以下代码的任何替代方案。
string[] ports = SerialPort.GetPortNames();
Run Code Online (Sandbox Code Playgroud) 我正在尝试为我的 sql 查询结果添加自定义消息,但找不到确切的方法来实现这一点。下面是我在 sql 查询中尝试的结果。
Select
'The Maximum Rating of the city' " + city + " 'is=' " + MAX(rating) + "
From
CUSTOMER
Where
CITY is not null
Group by
CITY;
Run Code Online (Sandbox Code Playgroud) 我创建了一个发布管道,负责将APK文件推送到App Center。但是,当我尝试部署该任务时,它总是失败并显示以下错误:
> <!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta
> charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Cannot
> POST
> /v0.1/apps/https://appcenter.ms/users/username/apps/VSTSBuild/release_uploads</pre>\n</body>\n</html>\n
Run Code Online (Sandbox Code Playgroud)
我的任务配置:
azure xamarin hockeyapp azure-devops visual-studio-app-center