简体   繁体   中英

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

I have created 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 (ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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