Object of type “X” cannot be converted to object of type “X”

后端 未结 8 1121
误落风尘
误落风尘 2020-12-09 16:10

(Can\'t believe this hasn\'t already been asked, but I can\'t find a dup)

In Visual Studio with lots of projects, when I first open the solution, I sometime

8条回答
  •  我在风中等你
    2020-12-09 16:43

    The Types indicated may have same name, same namespace, and same Assembly (DLL) but on different versions or location.

    You may try the following code on those two objects you are referring to define the location of their assemblies.

    SampleObject.GetType().Assembly.CodeBase
    

提交回复
热议问题