[英]The type “x” is defined in an assembly that is not referenced. VS 2010 C#
I am having a problem I just couldn't solve and would like some input. 我有一个我无法解决的问题,想要一些输入。
I am working with multiple class libraries in Visual Studio 2010, .net 4.0 Framework, in C#. 我正在C#中的Visual Studio 2010,.net 4.0 Framework中使用多个类库。 I have a class library project which references the assembly output(.dll file) of another Visual Studio solution.
我有一个类库项目,该项目引用了另一个Visual Studio解决方案的程序集输出(.dll文件)。 The reference was added correctly to the class library project (correct path, version, etc.).
该引用已正确添加到类库项目中(正确的路径,版本等)。 All types dependant on the referenced assembly are known by the compiler at design time (no red squiglies).
编译器在设计时就知道所有依赖于引用程序集的类型(没有红色波浪形)。
However, when I attempt to build the project I get the following error: 但是,当我尝试构建项目时,出现以下错误:
The type 'x' is defined in an assembly that is not referenced. 类型'x'是在未引用的程序集中定义的。 You must add a reference to assembly 'MyAssembly, Version=1.0.1.1, Culture=neutral, PublicKeyToken=null'.
您必须添加对程序集“ MyAssembly,版本= 1.0.1.1,区域性=中性,PublicKeyToken =空”的引用。
Note: type name replaced by x above. 注意:类型名称由上面的x代替。
It is as if the reference has not been added, but it has. 好像没有添加引用,但是已经添加了。 Has anyone else encountered a similar problem and discovered a work around?
其他人是否遇到过类似的问题并找到了解决方法?
Thanks so much, Andrew 非常感谢,安德鲁
Thats a weird one but it should be agnostic to Version ie its also applicable to VS 2005 and VS 2008. 那是一个很奇怪的问题,但是它对于版本是不可知的,即它也适用于VS 2005和VS 2008。
I just tested this like 5 mins ago just to make sure in VS 2008 Pro Edition using .Net 3.5 and C#. 我只是在5分钟前进行了测试,以确保在VS 2008 Pro Edition中使用.Net 3.5和C#。 NO PROBLEMS MATE !!!
没有问题的伙伴!
Just try following them steps and trouble shoot things as you go along as I made them steps before testing them and they still worked exactly fine afterwards when i did test them :p. 尝试按照它们的步骤进行操作,并按照我在测试它们之前进行的步骤进行故障排除,然后在我对它们进行测试时它们仍然可以正常工作:p。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.