0

I have two projekts in my c# solution explorer. The first project contains helper classes like a login to the database with NHibernate and some other stuff. My second project contains the main files for my programm like the GUI, their controllers etc.

The second project references on the first project because I want to use functions of my helper classes in the second project. I am able to compile the helper project with all its references (NHibernate.dll, Log4Net.dll etc.).

In the second project I face the following problem. There I also use some references that are already in the first project like the Log4Net.dll and of course I added a reference to my helper project because I want to use its functions. When I newly make all references everything is fine but when I compile the second project all references are away. Better to say they are still in the reference folder but in the class files the references are red underlined and VS 2010 Express tells me that the types / namespaces could not be found (missing using directive or assembly reference).

When I delete the references and make new references it works but again when I compile the project the same happens again.

What am I doing wrong?

4

2 回答 2

4

我要检查的第一件事是 Target Farmework,您是否将第一个项目定位到比第二个项目更高版本的框架?然后尝试将第二个项目设置为与第一个项目相同的目标框架,看看是否有帮助。

于 2012-12-17T09:44:20.390 回答
1

我认为您的第一个项目是针对 .net 4.0(完整)框架,第二个项目是针对 .net 4.0 客户端框架。

更改您的第二个项目,使其也以 .net 4.0(完整)框架为目标。

于 2012-12-17T09:51:06.847 回答