Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DocumentViewer WPF control not loading

It seems the DocumentViewer control may not like Windows 8. Just by having it on the form (with all the defaults, not data set to it or anything, it hasn't even finished InitializeComponent yet) I'm getting this error:

BindingFailure was detected

The assembly with display name 'PresentationUI.Aero2' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'PresentationUI.Aero2, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

If I get rid of the control, the issue goes away. Strangely, the designer has absolutely no problems with it at all.

I tried adding a reference to the only framework assembly with Aero2 in its name, that did nothing. And there are no references to this error anywhere on google. I'm trying to put together a documentpaginator, and I'm having to use a pdf printer to get around this issue, but I'm going to need a working viewer eventually.

like image 515
Patrick Avatar asked Aug 24 '26 12:08

Patrick


1 Answers

I had this same problem in a wpf 4.5 solution.

What I ended up doing was:

  1. creating a new blank solution
  2. then adding the existing projects from the "old" solution to the new solution. (for me my solution had 5 projects in it so I had to add them all).
  3. I then built and ran the new solution.

This solved the error and there are no references to Aero2 in any of my projects.

I am not sure why this fixed it, But I am glad that it did.

EDIT:

It seems that .suo file is the cause of all this. I've ran into this couple times - making a new project doesn't work, but new solution works - in the end I realized (thanks to a comment below) it's down to the .suo file. After removing it it worked ok.

like image 78
J King Avatar answered Aug 26 '26 02:08

J King



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!