Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

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 ?

like image 577
user310291 Avatar asked Dec 12 '22 19:12

user310291


1 Answers

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.

like image 88
Marc Gravell Avatar answered Dec 15 '22 09:12

Marc Gravell