Partial classes in separate dlls

前端 未结 7 951
野趣味
野趣味 2020-12-08 17:57

Is it possible to have two parts (same namespace, same class name) to a partial class in separate DLLs?

7条回答
  •  萌比男神i
    2020-12-08 18:35

    No. Partial classes are a purely language feature. When an assembly is compiled, the files are combined to create the type. It isn't possible to spread the files out into different assemblies.

    Depending on what you want to do, though, you might be able to use extension methods to accomplish what you need.

提交回复
热议问题