Search code examples
c#eventswindows-forms-designerprojects-and-solutionscircular-dependency

Event that manages two projects in Windows Forms


I want to pass information from one project to another with delegates. The project is with Sockets and I wanted that an event is triggered when either the client project or the server project send a data so that the information can appear in their respective information forms. But I have tried to make reference between these projects and he tells me that you can't because there can be a circular dependency.

How can I share the same event in two projects and make changes in the opposite form?


Solution

  • You will need to change your structure

    Projects

    Shared class library
       Shared stuff
    
    project 1
       reference -> Shared class library
    
    project 2
       reference -> Shared class library