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?

3
  • 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 3, 2013 at 20:08
  • 1
    Related question that might help: stackoverflow.com/questions/2046012/…
    – devuxer
    Oct 3, 2013 at 20:09
  • @DanM, thanks... Eric's answer on that questions got me thinking about the problem differently enough that I could solve it. Oct 3, 2013 at 20:31

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.