473,325 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

"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
Nov 22 '05 #1
0 909

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Good Enchiladas | last post by:
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: ...
0
by: Michael Steidl | last post by:
I use XMLspy for handling XML files and started testing its feature to generate C# code from XML Schemas. Now I got stuck in a strange situation: (I have to add being not a C# geek, only currently...
5
by: Lionel | last post by:
Hello all, two quick questions: One: What is the difference between adding a reference to something in my C# project so I can use it (for example, adding a reference to "Microsft.DirectX" when...
5
by: TomislaW | last post by:
What is asp.net equivalent for Application("Root") in asp?
14
by: Geoff Jones | last post by:
Hi I'm trying to use a class that I've written in a form. Unfortunately, when I write something like: Public x As New myClass I get the compile time error: "Type Expected". Indeed, the...
2
by: Kevin Frey | last post by:
Is it possible to get c# perform a using statement where the namespace for the using is not specified literally but instead comes from a variable, a token, a predefined value etc. We have...
1
by: pamelafluente | last post by:
Hi, Assume that I have a web application. I want to be able to use the classes that are in another project (say a Win application) on which I am working at the same time. Is it possible to...
2
by: Steve | last post by:
Kind of a strange question... I have a VB.NET 2.0 solution containing a main project (my EXE) and a number of other projects (class DLLs) that are "plug-ins" to the main app. These plugins get...
3
by: Lord0 | last post by:
I am trying to implement variable content containers using an abstract type and type substitution. My schema is as follows: <?xml version="1.0" encoding="UTF-8"?> <schema...
2
by: =?Utf-8?B?UGF1bCBMaW52aWxsZQ==?= | last post by:
I have a solution that has both c# and vb.net projects. Visual Studio 2005 sp1. One of the lower level asseblies "Utils.csproj" is a c# project that references a 3rd party dll "Framework.dll"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.