2

I have a wpf 4.5 application where I want to use a document viewer in an attempt at creating my own report viewer (based on this example). But if I add a DocumentViewer to one of my user controls I get the following error during the initialize component for the usercontrol.

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.

But as you can see from the screen shot of my references, this file is included:

enter image description here

I get this error even if the document viewer is empty.

What I tried:

  1. I used blend4 to edit the default style of the DocumentViewer Control. I removed all style references that used control parts from the Aero2 library. I even tried using an empty style. But the error still appears.
  2. I created both a wpf 4 and wpf 4.5 empty solution and added a document viewer to the main window. THe projects both run without error and they both run without adding a reference to any Aero Presentation dll.
  3. I tried to add a new wpf project to the solution where I am getting the error. IN that project I added a documentviewer to the main window, and the same error was generated. It seems to be solution specific.

Problem

Can someone help me figure out why I am getting this error, or how to remove the control's dependency on this Aero2 dll.

thank you in advance

J King
  • 4,108
  • 10
  • 53
  • 103

1 Answers1

0

How I solved this:

  • 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.

J King
  • 4,108
  • 10
  • 53
  • 103