Why can't I reference a class in another namespace in another project within the same solution?
I have c开发者_运维知识库reated another namespace in another project but within the same solution. When I type using this other namespace it shows up. But I cannot see any public class within that namespace. What's wrong ?
Since the type is public, this sounds as simple as a missing project reference between the two. Right click references and add a new reference, but watch that references shouldn't become circular (i.e. A <===> B, or A ===> B ===> C ===> A). Actually, the VS IDE doesn't let you do this, but it can be done (accidentally or purposefully) via the command-line tools.
You have to
- reference the exporting assembly in the importing project
- define 1 or more public classes in the exporting project.
精彩评论