Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/330.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Silverlight OpenFileDialog导致浏览器崩溃_C#_Silverlight_Internet Explorer - Fatal编程技术网

C# Silverlight OpenFileDialog导致浏览器崩溃

C# Silverlight OpenFileDialog导致浏览器崩溃,c#,silverlight,internet-explorer,C#,Silverlight,Internet Explorer,我们有一个Silverlight应用程序,允许用户上传保存在数据库中的文档。最近,当单击按钮选择文件时,OpenFileDialog导致浏览器崩溃。我已经在IE 8/9中复制了这一点。有时,如果运气好,它会按预期工作,并将选定的文件信息返回到应用程序代码中,但其他时候,在使用该对话框时,IE实例运行的cpu核心将跳到90%+。当对话框关闭时,IE9将完全挂起,而IE8将假装工作,让UI响应鼠标悬停,但不会接受任何实际输入 以前有其他人有过这个问题吗?它似乎与Silverlight/Windows

我们有一个Silverlight应用程序,允许用户上传保存在数据库中的文档。最近,当单击按钮选择文件时,OpenFileDialog导致浏览器崩溃。我已经在IE 8/9中复制了这一点。有时,如果运气好,它会按预期工作,并将选定的文件信息返回到应用程序代码中,但其他时候,在使用该对话框时,IE实例运行的cpu核心将跳到90%+。当对话框关闭时,IE9将完全挂起,而IE8将假装工作,让UI响应鼠标悬停,但不会接受任何实际输入

以前有其他人有过这个问题吗?它似乎与Silverlight/Windows相关。。。我们的应用程序代码中没有任何古怪的东西会导致这样的事情。此外,崩溃发生在OpenFileDialog.ShowDialog()方法内部。这不是一件容易调试的事情

XAML:


您是否安装了最新的Silverlight?您是否安装了所有IE更新?如果运行Silverlight应用程序的页面在受信任的站点区域(受保护模式之外)运行,问题是否会消失?我们安装了Silverlight 5.1.20913.0,我认为这是最新版本,并且安装了所有IE更新。应用程序在子域上运行,我们的s.o.p.将*.ourdomain.com列在受信任的站点中,安全设置为低;这些设置确实存在问题。
<Button Content="Browse" Height="{StaticResource ButtonHeightDouble}" HorizontalAlignment="Left" 
     x:Name="Browse" Width="{StaticResource ButtonStandardWidthDouble}"  
     Style="{StaticResource GrayButtonStyle}"  
     Foreground="White" FontWeight="Bold" VerticalAlignment="Top" 
     Margin="{StaticResource SmallGapVerticallyStackedThickness}"/>
public void Browse()
{
    OpenFileDialog openDialog = new OpenFileDialog
    {
        Filter = "Quote Files (*.pdf;*.jpg;*.jpeg;*.docx;*.doc;*.xlsx;*.xls;*.tif;*.tiff)|*.pdf;*.jpg;*.jpeg;*.docx;*.doc;*.xlsx;*.xls;*.tif;*.tiff",
        Multiselect = false
    };

    // wrapping this in a try/catch does not catch anything if it crashes
    if (openDialog.ShowDialog() == true)
    {
        try
        {
            // do things with the file;
            // if crash occurs, this code is never reached
            // even if "Open" is clicked in the dialog box
        }
        catch (FileNotFoundException ex)
        {
            SilverlightMessageBoxLibrary.Message.ErrorMessageLarge(ex.Message);
        }
    }
}