Title: DocumentViewer WPF control not loading
Tags: c#;.net;wpf-controls
Question: 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=151.154.11.224, 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 deleonjessica@example.net.
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.
Comment: No. It looks like the same issue though. I ended up just displaying it with regular controls and printing it blind.

Comment: Nope. Went with alternatives.

Comment: I am having the same problem, did you ever get this working?

Comment: I'm getting:
Could not load file or assembly 'PresentationUI.Aero2, Version=151.154.11.224, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. when I construct a FlowDocumentScrollViewer.  Have you solved your issue yet?


Here is another answer: I had this same problem in a wpf 4.5 solution.
What I ended up doing was:
creating a new blank solution
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).
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.
Comment for this answer: I tried this and it worked for me.
After making the change and doing a diff, I noticed a few things were changed, but I don't think that made a difference.  The order the projects are listed changed, but when I made the old solution match the order of the new solution, it didn't resolve the problem.  The other change was the configuration platforms were different, but again, after making them match it didn't solve the problem.  I even named the new solution to be the same as the old, and still no problems.
So in essence, it works, but I haven't a clue as to why it works.
Comment for this answer: I had the exact same problem and this solution worked for me as well. I would just like to add that replacing the sln file didn't work, only when I replaced the .suo file it worked! But comparing two binary files is difficult, so I don't know exactly what the problem was unfortunatly.
Comment for this answer: Interesting. Run a Diff on the project/solution files and see what's different. It could be something as simple as load order.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 4, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:02/01/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><.net><wpf-controls>', 'Title': 'DocumentViewer WPF control not loading', 'ViewCount': 1269, 'id': 14649813, 'user_AboutMe': '<p>Windows and Web developer, highly skilled in C#, TypeScript, Angular, RegEx and SQL.</p>\n', 'user_AccountId': 104278.0, 'user_DisplayName': 'Patrick', 'user_Reputation': 1726.0, 'user_Views': 251.0, 'user_id': 278889.0}}