473,468 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Build error for VB.NET but not C#

While building on a class library for an VB.NET object model, I get
something similar to the above error message, but not with C#.

The steps to recreate the problem are as follows:

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

using System;
namespace RootLevel {
public class Root {
}
}

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

using System;
namespace SecondLevel {
public class Child {
private RootLevel.Root _root;
public RootLevel.Root Root {
get {
return _root;
}
set {
_root = value;
}
}
}
}

3. Edit the Root class, add a reference to SecondLevel.dll and Re-build the
RootLevel.dll. The edited code looks like this:

using System;
namespace RootLevel {
public class Root {
private SecondLevel.Child _child1; //there will be other children
public SecondLevel.Child Child1 {
get {
if (_child1 == null) {
_child1 = new SecondLevel.Child();
_child1.Root = this;
}
return _child1;
}
}
}
}

And it builds without an error. Unfortunately, using VB.NET, it doesn't.

1.

Public Class Root
End Class

2.

Public Class Child
Private _root As RootLevelVB.Root
Public Property Root() As RootLevelVB.Root
Get
Return _root
End Get
Set(ByVal value As RootLevelVB.Root)
_root = value
End Set
End Property
End Class

3.

Public Class Root
Private _child1 As SecondLevelVB.Child 'there will be other children
Public ReadOnly Property Child1() As SecondLevelVB.Child
Get
If _child1 Is Nothing Then
_child1 = New SecondLevelVB.Child
_child1.Root = Me
End If
Return _child1
End Get
End Property
End Class

I believe my conversion from VB.NET to C# is 100% equivalent.

The reference to 'Me' in VB.NET step 3 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 can I fix the VB.NET situation. Is this a VB.NET compiler bug or a
default C# setting that differs? How do I work around this circular
compilation reference situation or whatever is going on here?

Thanks,
Kelly
Nov 22 '05 #1
2 1339
Hi Kelly,

You have 2 answers in the language group.
Please do not multipost (sending different messages to more dotnet
newsgroups. that is anoying to answer).

Crossposting (sending one message to more newsgroup is no problem in dotnet
newsgroups)

Cor
Nov 22 '05 #2
Hi Kelly,

You have 2 answers in the language group.
Please do not multipost (sending different messages to more dotnet
newsgroups. that is anoying to answer).

Crossposting (sending one message to more newsgroup is no problem in dotnet
newsgroups)

Cor
Nov 22 '05 #3

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

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
10
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
5
by: David++ | last post by:
Hi there, I have built a DLL in Visual C++ 6. When I build the DLL it builds fine for the debug version of the DLL (and this DLL works fine), however, I seem unable to build a Release version of...
0
by: ktelep | last post by:
I'm trying to build python 2.4.2 on AIX 5.3 with the IBM xlC compiler as per the notes in the AIX Readme file. Basically my make fails with the errors listed below. I'm calling configure with:...
1
by: | last post by:
I'm having a problem finding the cause for this problem. I have a solution in Visual Studio 2005 that contains two projects -- a Web Site and a Class Library. The web site references the class...
1
by: Ted Zeng | last post by:
Hi, I am new to Python. I am trying to build MySQLdb for my PowerPC PowerMac. I just downloaded the source last week and tried to build it. But I got the error messages as follow. I checked and...
6
by: Soren | last post by:
Hi! I'm trying to extend my python program with some C++ code. Right now I've spent hours just trying to get boost to work! I'm trying to get the example hello.cpp to work. Using Windows XP...
0
by: Darrin Thompson | last post by:
I've been trying to build pyOpenSSL on Windows with Visual Studio 2003. I've hit the message below: building 'OpenSSL.SSL' extension creating build\temp.win32-2.5\Release\src\ssl C:\Program...
5
by: eranshuman | last post by:
Hi, I m very new to perl I m running an API which have the Buil.pl When Im compiling using perl Build.pl I was getting error : Can't locate Module/Build.pm in @INC (@INC contains:...
1
by: Owen Zhang | last post by:
I am trying to build lxml package in SunOS 5.10. I got the following errors. Does anybody know why? $ python setup.py build Building lxml version 2.1. NOTE: Trying to build without Cython,...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.