0

We have two projects name Service and Utilities. The Utilities project is referencing Service project.

Here is what Utility class looks like.

 namespace Utilities{
 public class Classname{
   public static void Start(){

   }
  }
}

Here is what Service class looks like.

namespace service 
{
 public class serviceclass
  {
     public void servicemethod()
     {
        TO DO : need to access utilities method start() here
     }
  }
}

Cannot add reference since it causes circular reference.

rs232
  • 1,248
  • 8
  • 16
Nirav Parmar
  • 451
  • 3
  • 12
  • 3
    Why does the utility class depend on the service class? Remove this reference. If there are some utility functions in the service project that are referenced by the utility project, move them to the utility project. – Neil Aug 22 '18 at 13:41
  • 3
    A utilities project typically shouldn't have references to anything else. It should all be self-contained code. – AotN Aug 22 '18 at 13:44
  • @Neil - The project is not designed by me. I am just working on one piece of code. The project is big and removing reference will cause lot of changes. – Nirav Parmar Aug 22 '18 at 14:06
  • @guy - i tried that but i get error since i have static class. can you provide short term solution to fix this issue? – Nirav Parmar Aug 22 '18 at 14:06
  • You can have cross-referencing assemblies (of course you can - look at several of the core framework ones) but it's a lot of work and you'll just confuse most people. Here's [one way to do it](https://stackoverflow.com/a/44431210/15498) – Damien_The_Unbeliever Aug 22 '18 at 14:13

0 Answers0