开发者

Why can't I reference a class in another namespace in another project within the same solution?

开发者 https://www.devze.com 2023-01-18 06:55 出处:网络
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 nam

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.
0

精彩评论

暂无评论...
验证码 换一张
取 消