'FileNotFoundException exception in PresentationCore.dll for DragDrop.DoDragDrop on one single host

The following code shows a FileNotFoundException on one single host (in PresentationCore.dll with HRESULT: 0x80070002)

private void OnMouseMove(object sender, MouseEventArgs e)
{
    Ellipse ellipse = sender as Ellipse;
    if (ellipse != null && e.LeftButton == MouseButtonState.Pressed)
    {
        try
        {
            DragDrop.DoDragDrop(ellipse,
                                 ellipse.Fill.ToString(),
                                 DragDropEffects.Copy);
        }

        catch(Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
}

Using procmon.exe on this executable shows that PresentationCore.dll is found, but also PresentationCore.pdb is searched.

The same host shows also problems for drag and drop operations in Visual Studio 2017 and in some other applications.

I've tried to track down the problem with procmon.exe as well as with FUSLOGVW.exe.

I've reinstalled Visual Studio as well as the other applications. I've also tried to run the. NET Framework Repair Tool, but the problem does not go away.

Is there any other thing I could do besides re-installing Windows 10?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source