1
我在使用Windows Server 2008中運行的WPF應用程序中的OpenFileDialog(來自System.Windows.Forms)時出現問題。當我單擊按鈕時,鼠標切換到「等待模式「,然後轉正常,沒有任何反應,沒有一個窗口顯示。但是,當我在WindowsForm應用程序中使用相同的方法時,它在同一臺服務器上運行。WPF - 打開文件對話框WPF和服務器
我這個代碼測試:
try
{
System.Windows.Forms.OpenFileDialog dialog = new System.Windows.Forms.OpenFileDialog();
dialog.ShowHelp = false;
dialog.Multiselect = false;
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
return;
txtCaminho.Text = dialog.FileName;
}
catch (Exception ex)
{
MessageBox.Show("Exception: " + ex.Message);
}
服務器是在Windows Server 2008,R2,X64與.net 4.5.2。應用程序以x86模式運行。
我也嘗試使用FileDialog的從的Microsoft.Win32和Microsoft.WindowsAPICodePack.Dialogs
正常工作對我來說,必須在你的項目中別的東西,你看到在一個獨立的測試程序這種行爲? –
是的,這發生在所有使用OpenFileDialog的WPF應用程序中,僅在此服務器中。我發佈的代碼來自獨立測試本身。 –