The first project defines a class and an interface that the class expects a
different class to implement. In the second project define a class that
implements the interface.
' Project 1
Public Interface INeedThis
Sub DoSomeWork()
End Interface
Public Class Class1
Public Sub DoSomething(ByVal needThis As INeedThis)
needThis.DoSomeWork()
End Sub
End Class
' Project 2
' references project 1
Public Class NeedThis
Implements INeedThis
Public Sub DoSomeWork() Implements INeedThis.DoSomeWork
End Sub
End Class
Notice that Project 2 references Project 1, but Project 1 does not reference
Project 2. If you want you can put the interface in its own project if you
have a number of interfaces.
Project 1 will need to be a class library. Project 2 can be a class library
or an Application.
You can't. When you develop library 1 it needs to reference library 2, so
library 2 must be developed first. You can't develop library 2 first because
it needs to reference library 1.
You may consider a redesign by introducing a lower (common) layer referenced
by both libraries.
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.