XBAP DragDrop System.ExecutionEngineException PROBLEM

May 20 2011 8:46 AM

Hello geeks,

I am facing a serious problem with XBAP. While performing DragDrop.DoDragDrop method it gives me System.ExecutionEngineException. this causes entire application crash.  I have tried a lot but didnt worth anything.

 

My process is like this.

 

I am using wpf treeview. When I drag a treenode I am setting  UIElement as DropData.

[DragDropEffects finalDropEffect = DragDrop.DoDragDrop((DraggingElement as FrameworkElement).Parent, DraggingElement, DragDropEffects.Copy);]

 

 

Now if this drag is going out of navigationWindow (IE in this case) change DropData with actual file name bound with that treeNode.

[DragDrop.DoDragDrop(this, new DataObject(DataFormats.FileDrop, new String[] { AppDomain.CurrentDomain.BaseDirectory + "Temp\\" + ((tvMainTree.SelectedItem as TreeViewItem).Tag as Document).DocumentName + "." + ((tvMainTree.SelectedItem as TreeViewItem).Tag as Document).DocumentExtension }), DragDropEffects.Copy);]

 

In this case while setting the second code line I am getting System.ExecutionException. EVEN If i put direct file path in first code line and comment second line, it drops the file at targeted location but after dropping it gives the same exception. The thing was working properly before but I dont know why it is behaving strange now.

 

Can anybody give some guidance.


- Regards,
Bhagyesh Joshi, India.

Answers (3)