473,400 Members | 2,145 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,400 software developers and data experts.

Intermittent compiler error

Using Visual Studio .NET 2003, I'm intermittently getting the VB.NET error BC30002 ("Type ... is not defined.") when I build a particular assembly that I have written. This error does not occur every time the assembly is built, and seems more likely to occur when a change has been made in the assembly and it is another dependent assembly that is being built.

The type that it claims is not defined is a nested class which is derived from another nested class within the parent class' base class. I.e., DerivedClass.DerivedNestedClass, defined as (in pseudo code):

public class DerivedClas
inherits BaseClas

protected class DerivedNestedClas
inherits BaseClass.NestedClas
Nov 22 '05 #1
2 1302
Hi Chris

This is one of those niggly things that is oft' reported but for which no
one seems to have a hard and fast resolution. I get exactly the same thing,
but hopefully the following will help:

I have found that the more tightly coupled a solution, the more likely the
problem is to occur. Also, check the references section of each project
properties in your solution, and make sure that there are no erroneous
entries. The order of the directories listed also seems to make a
difference. Try to be consistent in the order, i.e. order the references the
same way for each project.

The problem seems more prevalent when there are multiple classes with the
same name, or where a property has the same name as a class.

Organise classes to maintain the minimum scope across the solution, i.e.
make things private wherever possible, and refactor in order to decrease the
scope as far as possible.

HTH

Charles
"Chris Peacock" <ch****************@videss.co.uk> wrote in message
news:12**********************************@microsof t.com...
Using Visual Studio .NET 2003, I'm intermittently getting the VB.NET error BC30002 ("Type ... is not defined.") when I build a particular assembly that
I have written. This error does not occur every time the assembly is built,
and seems more likely to occur when a change has been made in the assembly
and it is another dependent assembly that is being built.
The type that it claims is not defined is a nested class which is derived from another nested class within the parent class' base class. I.e.,
DerivedClass.DerivedNestedClass, defined as (in pseudo code):-
public class DerivedClass
inherits BaseClass

protected class DerivedNestedClass
inherits BaseClass.NestedClass
.
.
.
end class
.
.
.
end class

public mustinherit class BaseClass
implements AnInterface

public mustinherit class NestedClass
.
.
.
end class
.
.
.
end class

AnInterface is used to expose a COM IDispatch interface to BaseClass (in case that's relevant).
When the compiler does not complain, all of the code seems to work fine. Almost always, changing something unrelated in the contents of the classes
involved makes the error go away - it will then appear again later, for no
apparent reason!
There is obviously a lot more to the class structure than I have shown here such as virtual (mustinherit) functions and properties. I've spent a
lot of time trying to tweak things to fix the problem, and so don't really
have time to pinpoint the exact cause of it - I was hoping someone else may
have experienced the same thing and be able to point me in the right
direction. I would happy to include more about the class structure on
request, however, if anyone has any ideas about this.
Thanks for any help.

Nov 22 '05 #2
Thanks Charles, I'll give these things a go. I wish MS would fix this problem though, as we've suffered with it since version 2002.
Nov 22 '05 #3

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

Similar topics

3
by: Chris Peacock | last post by:
Using Visual Studio .NET 2003, I'm intermittently getting the VB.NET error BC30002 ("Type ... is not defined.") when I build a particular assembly that I have written. This error does not occur every...
10
by: Robert | last post by:
We have an ASP.NET site that performs a lot of xml serialization. The serialization occurs in the lbolibrary dll. Occasionally we get an .out file produced in the Winnt\temp folder that contains...
0
by: deevoy | last post by:
Hi- I'm developing a asp.net web application and everything has proven fine on the dev and acceptance environment. We've moved the code up to our windows server 2003 prod environment and get the...
8
by: trinitypete | last post by:
Hi all I have a strange problem with IIS windows pass through authentication. Heres the setup IIS running with Windows Authentication for our intranet site. ACL has been set to everyone for all...
3
by: Lee Chapman | last post by:
Hi, I have a problem where my ASP.NET application occasionally generates a MissingFieldException exception. This unexpectedly happened on my development box, and so I was able to extract some...
1
by: deevoy | last post by:
Hi- I'm developing a asp.net web application and everything has proven fine on the dev and acceptance environment. We've moved the code up to our windows server 2003 prod environment and get...
0
by: Shane C | last post by:
Intermittent Error: Server was unable to process request  Object reference not set to an instance of an object I have windows application that references a XML web service on our web server. ...
8
by: Dave | last post by:
I am getting an intermittent database error on my asp page. I am using Access 2003 with classic ASP. The error is this: Microsoft JET Database Engine Error 80040e10 No value given for one or...
0
by: =?Utf-8?B?QnJhZA==?= | last post by:
We are developing a complex ActiveX control and for the most part all is well. We test this in many environments and one thing we have noticed is that ALL of our C# apps (using .NET 2003) have an...
3
by: =?Utf-8?B?UGF1bCBIYWxl?= | last post by:
Moving all User Controls to a single directory has solved my problem - Thanks Eliyahu. That said, I still got one Circular ref error yesterday, rebuilt again and the build was fine? Far far...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.