Pergunta

I have a solution that has one class library project, and the others are WPF applications. I have added class library's reference the but, but both of them cannot use its classes.

So, what is the problem?

NOTE: sorry for tags, it's safari's problem.

Foi útil?

Solução 4

Found the problem. One of my references in class library has caused it, and I have removed it. Now I can built the solution without errors.

Thanks for your comments..

Outras dicas

Make sure that all your projects target same Framework. It may be a case that your library class project targets full .Net Framework 4.0 while your wpf projects target .Net Framework 4.0 Client Profile.

To do that go to project properties of each project in a solution and check Application | Target Framework property. Alternatively you can download VSCommands 2010 extension and see all properties in one place via Solution Properties window.

Things to check:

  • The class library classes are public
  • You have an appropriate using directive in your calling code:

    using MyCompany.ClassLibrary;
    

If that doesn't help, please post what happens when you try to use the classes from the library.

I got the same problem, but the solution was different...

We work in team and one of the developers (called dev1) installed the .NET 4.5 (the others has only the .NET 4.0). After dev1 made some changes in the solution the others got the problem, and colud't build. The project referrences didn't work (but if they used it like a dll it worked)... So we install the .NET 4.5 for everybody and it resolved the prolem.

Moha

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top