Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
I have a big solution with 10-20 projects in it, and I am an advanced user of VS 2010. I have VS 2010 and the customer's system is Windows 7, 64 bit. I have Visual Studio 2010 Service Pack 1.

Anyhoo, I have this one class library project (DLL) and it has an interface that is declared public, like so:

namespace MyNamespace {
    public interface MyInterface {
         void Foo();
    }
}


And I have a class in the same project:

namespace MyNamespace {
    public class MyClass : MyInterface {
         public void Foo() {
             // ...
         }
    }
}


And this class library project builds successfully. I am under .NET Framework 4 as my framework. No .NET Framework 4 Client Profile, none of that -- the full version.

Now I have another C# class library project in the same solution and I go right-click on the calling project in solution explorer -> Add Reference -> Projects tab -> Project1 (the original class library).

Then right away, the reference shows up in Solution Explorer and it has a yellow exclamation mark overlaid on top of the reference icon, and MyInterface shows up in the IntelliSense as being able to be called, but MyClass will not show up in the IntelliSense, nor does the compiler see it. I have added a using statement for the MyNamespace namespace.

Plus, there is another class, MyClass2, in the same initial class library project, in its own file and in the correct nameapace. And again, the calling library cannot see it. This is just random. I cannot see any difference between MyClass2 and MyClass3 which is another class in the first class library that is also in the correct namespace and everything is defined as public and this is just so bizarre, as to why these two classes are just now showing up.

So I guess the question is twofold:

(1) if my first class library builds OK, why is its reference yellow exclamation mark? VS gives me no hints at all, no tooltips, no build errors, nothing as to why this is so.
(2) Why are some classes from the referenced class library visible and not others?

I have done the usual "Clean" and "Rebuild Solution" yada yada yada...

Any hints would be very much appreciated. Thanks.
Posted
Updated 25-Nov-13 12:43pm
v2
Comments
Pheonyx 25-Nov-13 19:18pm    
This new class library project that is referencing the one that builds, have you checked its .Net framework version. (You mentioned you did for the first one but not for the latter).

Also check that you are not building one as 64bit and referencing that in a 32bit dll as I believe that will fail, but would work the other way around. (Correct me if I'm wrong).
Sergey Alexandrovich Kryukov 25-Nov-13 19:46pm    
Not clear. Are you sure the target .NET versions of all projects are compatible? Target platform compatible? Are you sure the types and their members you are interesting in are public? Are you sure you really referenced assemblies via referencing the project of some solution? Can you browse references?
—SA
BillWoodruff 25-Nov-13 19:56pm    
I assume you have inspected the Solution/Properties/Property Pages Dialog/Common Properties/StartUp Project sub-Dialog, and you are using Multiple Build ... and everything looks as expected ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900