Warning “The type X in Y.cs conflicts with the imported type X in Z.dll”

后端 未结 9 1083
Happy的楠姐
Happy的楠姐 2021-01-03 17:41

The main.cs of my project returns the following warning:

Warning 1 The type \'Extensions.MessageDetails\' in \'PATH\\Extensions.cs\'

9条回答
  •  盖世英雄少女心
    2021-01-03 18:23

    If you really need to have both classes declared or referenced in two separate dll, you can mark your class as internal.

    Internal types or members are accessible only within files in the same assembly, therefore it will prevent the collision.

提交回复
热议问题