Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Warning CS1684: Reference to type X claims it is defined in .. but it could not be found"

I'm getting this warning when building a test project we'll call PWTests.

Warning CS1684: Reference to type 'System.Windows.Input.ICommand' claims it is defined in 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\System.dll', but it could not be found

This project is supposed to test a class library which we'll call PW. I cannot determine why it thinks System.Windows.Input.ICommand is defined in System.dll. PresentationCore, where ICommand is actually defined, is properly referenced in the test project, and the class library project. I've tried removing the reference to PresentationCore, cleaning, and re-adding it (as mentioned in other questions) which did not work.

How can I determine what is causing it to think that ICommand is in System.dll?

like image 843
Rob K Avatar asked Jul 15 '14 20:07

Rob K


1 Answers

We really need more information, but here is how I have solved this.

Tends to be when you've added something by nuget or something like that, if you look in your app.config you'll see some redirects in there (probably) check the assembly that ICommand is in (usually in your bin folder or directly referenced) and ensure that the versions line up in there.

It would help if you posted your app.config and state the assemblies you are using so I can be more accurate.

like image 132
krystan honour Avatar answered Nov 12 '22 23:11

krystan honour