Hello,
I'm currently developing on a large project where several assemblies
build into DLLs that support the final .NET EXE. The original plan was
to implement the project in VB.NET, so the EXE project is a VB WinForms
App. Later on we got approval to not stick to that requirement so I
started writing library code in C# (which I much prefer).
Of interest in my problem are two C# DLL projects aside from the main
EXE project. The first, we'll call it 'A', contains a code file with a
few general no-arg delegate declarations. Then, an interface in the
other C# project, which we'll call 'B', contains declarations of events
using this delegate-type.
Finally, one of the Forms in the VB EXE implements this interface and
thus implements the events from the C# interface in assembly B. This
seemed to work okay earlier and not give any errors, but perhaps other
errors that I have since resolved were blocking the notification of
these errors, so the problem could have been there all along since I
started using the delegates/interfaces. I'm not entirely sure on that.
If I build assembly A or B separately, I get no problems. They compile
entirely. Remember that the interface in B, uses the delegate in A, so
it can see it and use it fine according to the C# compiler. Then I try
building the VB EXE and it complains, saying
C:\MyPath\MainForm.vb(16707566): Type 'A.EventHandler' is not defined.
Obviously my code is not that long. The vb compiler made up that line
number, presumably as some default abstract designation. I'm not for
sure.
Yet I am not getting an error that says I am failing to implement the
interface. This is curious because the only way it can know that I am
correctly implementing the interface is if it knows about that
delegate-type. Before I fixed other problems, I was getting a compiler
error that told me I wasn't yet implementing the interface when I was
mismatching on some of the declarations between VB and C#. Once I fixed
those, those went away. So that error was accurately reflecting that
issue. So what could have occurred that it suddenly doesn't find a
declaration that had to have been used to help resolve another error
message?
All dependency references are project references (as opposed to
explicit DLL path references) and yes I've tried deleted all bin/obj
folders and then rebuilding.
Thanks.
/S