views:

1025

answers:

5

This is the error we get:

Error 1 The type 'System.Windows.Point' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. C:\PacMan\PacMan\PacMan\PacManTests\UnitTest1.cs 65 13 PacManTests

We get this error in our unit test project which cant find the System.Windows Assembly but our main project can find the assembly and run it fine.

Does anyone have any input or advice on where or how we can reference System.Windows to fix this problem?

+1  A: 

Right click on your "References" folder and click "Add Reference" and then select System.Windows under the .NET tab.

Nick Berardi
We have tried that there is no System.Windows under the .NET tab when we click on the references to add a reference.
That's very strange. What version of .NET do you have installed?
Jon Skeet
+5  A: 

Add the assembly reference as you'd add any other framework assembly reference:

  • Right-click on the project
  • Select "Add reference"
  • Select the .NET tab on the left, and find "System.Windows" in the list of assemblies
  • Double-click on "System.Windows" and the assembly reference will be added
Jon Skeet
A: 

You have to add the reference to the project. If you're using Visual Studio, right-click the project in the Solution Explorer, and choose Add Reference...

lc
+2  A: 

We found it we had to go into the Silverlight folder and found the System.Windows.dll and now all is good thanks for the help though!

I had the same problem - strangely it was just ReSharper flagging the error though my project compiled correctly, and it was in a server-side class library, not even a SL library.
Craig Shearer
A: 

well, it was actually system.windows.presentation in my wpf app...

Mike Graham