views:

60

answers:

3

I have a WPF/ASP.NET project which I haven't worked on for a while (ResourceBlender.NET - http://resourceblender.codeplex.com/). The project contains a DataLayer and a Core layer, these are both used by the WPF application and ASP.NET project in the solution.

If the WPF project is set as the startup project and I try to build the application, I get "The type or namespace name 'whatever' could not be found (are you missing a using directive or an assembly reference?)".

The error list shows these when I try to build, run or debug, but double clicking and going to the error shows no actual errors in the editor and everything is highlighted as normal.

The ASP.NET project builds fine. I'm absolutely clueless on this one, as there are no obvious errors to fix - could it be metadata somewhere?

+1  A: 

This type of thing is really hard to debug without being able to see your solution setup, but here are the things I would try:

  1. Expand the references in your WPF project, make sure they are all resolving
  2. Double-check that none of your references have "specific version" set to True and point to an old/nonexistent version
  3. Do a "Clean" on your solution, close VS and delete your bin and obj directories, etc. to clear out potentially old copies of dlls that may be messing up your build

Good luck!

Guy Starbuck
+1  A: 

Try the following:

  • Right-Click on the solution on do a "Clean Solution"
  • Try to build each project separately
  • Check the references on your projects for missing assembly references
Yves M.
A: 

Check that all assemblies does not target the 3.5/4.0 Client Profile (It is probably the WPF application that is the culprit). This will cause exactly the error message you're describing.

Goblin
This has never caused issues in the past, and didn't solve the problem completely (I needed to tweak a few namespaces and change a few other things around), but I'm over the moon. :) Thanks
Echilon
The problem is that if one of your assemblies depend on assemblies that were build prior to .Net 4.0 - they are not compatible with the ClientProfile.But, I'm happy you got it working :-)
Goblin