Inheritance only works if Project based and not File based

M

matthew_lancashire

First thing, I am using Framework 2.0 and VS2005 Beta 2.
I have a base class that implements an interface and has a must
override sub that implements an interface to a sub in the ompleneted
class interface.
If I create a class that inherits this base class and I as a file
reference to the base class it causes an error in the IDE. It undelines
the class name with the error that it cannot inherit the base class
because a mustinherit sub is missing, even when it has been inserted by
the IDE.
If I change the sub parameters to a simple type in bot the base class
and the new class it works.
If I add a project reference to the base class's project it works.
Neither of which is an option.
It is as if the new class has problems detecting the inherited object
types from the base class.

Any ideas?
 
C

Cor Ligthert [MVP]

Matthew,

Probably some less text and more code can give us the possibility to help
you. Now the only idea I have is that it is a nice puzzle for you because
you see the code and we don't .

Cor
 
M

matthew_lancashire

Base Class.

Public MustInherit Class MessageAgent
Implements Dispatcher.IServiceAgent
Public MustOverride Sub Execute(ByVal PersistCallBack As
Dispatcher.WorkerThread.PersistCallBack, _
ByVal inputParams() As Object) Implements
Dispatcher.IServiceAgent.Execute

End Class

Consumer Class

Public Class SMSMessage
Inherits Initial.Messaging.Agents.MessageAgent

Public Overrides Sub Execute(ByVal CallBack As
Dispatcher.WorkerThread.PersistCallBack, _
ByVal inputParamsArray() As Object)

Dim saResult as New ServiceAgentResult("Sending message.",
Nothing)
CallBack(saResult, True)
End Sub

End Class
 
C

Cor Ligthert [MVP]

Matthew,

I think that it is something in that Dispatcher.IserviceAgent that conflicts

However I have not the simplest idea what that can be, it took me to much
time helping you with that in my opinion few information you give, maybe
somebody else can helps you.

Cor
 
M

matthew_lancashire

Let me just add that the whole thing works fine in 2003 it is just when
I port it to 2005 it starts to not recognise the type
Dispatcher.WorkerThread.Persis­tCallBack when it is referenced through
my base class.
Also I have noticed that if I add a file reference sometimes it does
not recognise the path even when I browse to it I get the invalid
reference message in the References pane!?
 
C

Cor Ligthert [MVP]

Namespace.....
.......
.......
End namespace

In my test with your code I have added the namespace, did you do that as
well?

(I have the test not anymore however I thought it was that)

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top