469,658 Members | 1,862 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,658 developers. It's quick & easy.

"Reference required to assembly 'RootLevel' containing the type 'RootLevel.Root'. Add one to your project."

While building on a class library for an object model, I get the above error
message.

The steps to recreate the problem are as follows:

1. Build a RootLevel.dll containing only this code:

Public Class Root
End Class

2. Build a SecondLevel.dll containing a reference to RootLevel.dll and only
this code:

Public Class Child
Private _root As RootLevel.Root

Public Property Root() As RootLevel.Root
Get
Return _root
End Get
Set(ByVal value As RootLevel.Root)
_root = value
End Set
End Property
End Class
3. Edit the Root class, add a reference to SecondLevel.dll and Re-build the
RootLevel.dll. The edited code looks like this:

Public Class Root
Private _child1 As SecondLevel.Child 'there will be other children

Public ReadOnly Property Child1() As SecondLevel.Child
Get
If _child1 Is Nothing Then
_child1 = New SecondLevel.Child()
_child1.Root = Me
End If
Return _child1
End Get
End Property
End Class

The reference to 'Me' is marked with the following error by the Visual
Studio.NET IDE:
"Reference required to assembly 'RootLevel' containing the type
'RootLevel.Root'. Add one to your project."
Obviously, this a simplified example, where children are plugged into the
root as needed. The children can be pretty complex and considerably
different from each other. Children need to reference the root, and children
often need to reference each other.

How do I work around this circular compilation reference situation or
whatever is going on here?

Thanks,
Kelly
Jul 21 '05 #1
2 1383
Same answer as above
Jul 21 '05 #2
Same answer as above
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Michael Steidl | last post: by
5 posts views Thread by Lionel | last post: by
5 posts views Thread by TomislaW | last post: by
14 posts views Thread by Geoff Jones | last post: by
2 posts views Thread by Steve | last post: by
3 posts views Thread by Lord0 | last post: by
2 posts views Thread by =?Utf-8?B?UGF1bCBMaW52aWxsZQ==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.