Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1062953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:42:35+00:00 2026-05-16T18:42:35+00:00

I have an executable project called A.EXE which references a C# class library B.DLL.

  • 0

I have an executable project called A.EXE which references a C# class library B.DLL.

A.EXE generates events which are handled by a class in B.DLL. The events use a custom EventArgs child called ProjectEventArgs.

Do I need to add a reference for A.EXE to the B.DLL project so that the ProjectEventArgs class is defined? That doesn’t seem quite right to me as I think this is a circular dependency.

Is there some way to refactor my code to avoid this?

thanks, Andy

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:42:35+00:00Added an answer on May 16, 2026 at 6:42 pm

    You can’t reference a.exe from b.dll in the first place, so no, that isn’t the solution. Even if a was a DLL, you wouldn’t be able to do the reference because it would introduce a circular reference between assemblies, which is not allowed.

    First decision in refactoring your code, decide whether or not ProjectEventArgs belongs in the dll or the application. The way to do this is to check what other dependencies the ProjectEventArgs class has – is it depending on other types from A.exe, or has no other dependencies? (If the latter, stick it into the dll).

    In the case it does have dependencies inside A, you need to abstract the functionality of the ProjectEventArgs into a base (abstract) class, or an interface. (Or, since it’s a child of EventArgs already – can you not capture all the functionality you need by simply using the EventArgs from B?)

    Really could do with a code sample of your ProjectEventArgs class, and a snippet of where you use/call it to give an actual sample solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an executable project A, which references to a Class Library project B.
Assume I have an executable called 'exe' which spawns a child process. This child
I have a custom project type based on the C# Class Library project type
I have a class library which is called through COM from a Third Party
I have the problem running executable .jar file. I've created a project which contains
For various C++ library projects in VS2008 I have a sibling project called <libraryname>-Test
For a class project I have to use gcov to test coverage of a
I have solution with few Class Libraries and one Executable Project. Business logic is
I have an executable file - process.exe - which takes a single file path
I have a project with 5-6 libraries and one executable. The executable depends on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.