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

后端 未结 9 1080
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:13

    You can't have two copies of the extensions class, even though the code is the same they are not seen as the same object. Both your dll and main application will need to reference the exact same one.

    You could try creating a 'Common Files' class library and add the extensions class to it, that way you will always be using the correct class

提交回复
热议问题