Search code examples
c#.netmodulepartial-classes

Partial classes in separate projects


I have a question the answer i cant find for. I have solution with Module projects. There are the same class types in each. My purpose is to make them all partial and define partial method. I tried to use the same namespace and the same Project namespace, but it doesnt work. Can somebody give me an advice how to do that? Thanks so much. Upd. any workaround (in there is no straight way) will be appreciated


Solution

  • Unfortunately, you cannot have a partial class span multiple projects. Partial classes are only combined within individual projects/assemblies.

    See this StackOverflow post for more information and some possible workarounds (e.g. inheritance and extension methods).