简体   繁体   English

C#找不到使用和引用的类

[英]C# cannot find a used and referenced class

I and a few friends are building a program made from 4 projects we are putting together. 我和几个朋友正在构建一个由4个项目组成的程序,我们将这些项目放在一起。

While developing, we decided to move a class from one project to another. 在开发过程中,我们决定将课程从一个项目迁移到另一个项目。 We changed the namespace and made sure all of the projects reference to the one containing it. 我们更改了名称空间,并确保所有项目都引用了包含该名称空间的项目。

When running the project, the compiler gives a couple of error: 运行项目时,编译器会给出两个错误:

The type or namespace name 'dataList' could not be found (are you missing a using directive or an assembly reference?)

Cannot implicitly convert type 'DAL.dataList`1<classes.IBase>' to 'classes.dataList<classes.IBase>'

dataList is the class we moved from DAL to classes.

The class appears colored, and when I attempt to show the location by doing classes.dataList , it recognizes the class, but the compiler still gives the error. 该类显示为彩色,并且当我尝试通过classes.dataList来显示位置时,它可以识别该类,但是编译器仍会给出错误。

A problem that appeared to one of us was an internal conflict that the compiler was reading from a deleted old file instead of the correct one (so it failed to load it properly), but it was fixed, and now this popped up. 我们当中一个出现的问题是内部冲突,即编译器正在从已删除的旧文件中读取而不是从正确的文件中读取(因此无法正确加载),但此问题已得到解决,现在弹出了。

It was resolved- I'm not entirely sure why or how. 解决了-我不完全确定为什么或如何。 As far as I gathered, one of us played with the DAL, added and removed the references and it solved the issue. 据我所知,我们中的一个人与DAL合作,添加和删除了参考文献,从而解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM