C # WPF OpenFileDialog crashes in XP, not Vista

I have a WPF application that works fine on my Vista development machine, but not on XP products. The only problem is calling OpenFileDialog.Show (). As soon as I call the method, the application will be terminated in the XP field.

The problem does not raise an exception. (I surrounded the block in the try-catch block to no avail.) When I click on File-> Open, the application only upwards and exits in XP. Interestingly, I can write files to disk using File-> Save and use the Save As dialog. I tried to create it for .Net 3.0 and 3.5, but that does not make any difference.

I tried using Microsoft.Win32.OpenFileDialog and System.Windows.Forms.OpenFileDialog and get the same symptom.

Code block for Microsoft.Win32 variant:

try  
{  
    OpenFileDialog ofd = new OpenFileDialog ();
    if (ofd.ShowDialog (). Value)
    {
        // do something
    }
}
catch (Exception ex)
{
    MessageBox.Show (ex.ToString (), "Error!");
}

The only keys I have are the following (partial) entry from the security event log.

Event Type: Failure Audit
Event Source: Security
Event Category: Object Access
Event ID: 560
Description:
Object Open:
        Object Server: Security
        Object Type: Key
        Object Name: \ REGISTRY \ MACHINE \ SOFTWARE \ Microsoft \ EnterpriseCertificates \ Disallowed
        Accesses: DELETE
                        READ_CONTROL
                        WRITE_DAC
                        WRITE_OWNER
                        Query key value
                        Set key value
                        Create sub-key
                        Enumerate sub-keys
                        Notify about changes to keys
                        Create link

? (Pleeeease!)

+3
3

. , . , .Net 3.0 ( ), .Net 3.5 SP1, . .Net 3.5 SP1 .

. , .

+1

, . , ACL ( XP, ).

, .NET(, reset permissions ).

, XP , - .

0

It seems your production assembly is working under full confidence. Are you using a network resource?

0
source

Source: https://habr.com/ru/post/1761151/


All Articles