0

I'm getting a few:

'The type or namespace 'blah' does not exist in 'A.B.C' (are you missing an assembly reference?)

The code looks like:

namespace A
{
   using B.C;

   public class Blah()
   {
      //...
   }
}

A and B are both assemblies that are included in the solution. Both use .NET 4.0. Assembly B does in fact have a namespace C. Assembly B is included as a reference in assembly A.

Why is it looking for A.B.C when the reference is B.C?

Robert Gowland
  • 7,677
  • 6
  • 40
  • 58
  • Would you mind providing a complete example with a skeleton for all the assemblies in question? Also, what line exactly is causing the error? – devuxer Oct 03 '13 at 20:08
  • 1
    Related question that might help: http://stackoverflow.com/questions/2046012/companyname-foo-is-a-namespace-but-is-used-like-a-type – devuxer Oct 03 '13 at 20:09
  • @DanM, thanks... Eric's answer on that questions got me thinking about the problem differently enough that I could solve it. – Robert Gowland Oct 03 '13 at 20:31

1 Answers1

1

The problem was a typo in a different file than the ones with errors.

In another file I had:

namespace A.B.C
{
//...
}

I must have done an accidental Ctrl-P at some point?

The steps I took to find the offending file:

  1. Open up the most recent file that I had changed
  2. Examine the namespace
  3. Repeat with the next most recent
Robert Gowland
  • 7,677
  • 6
  • 40
  • 58