error CS0266: Cannot implicitly convert type 'object' to 'string'

  • Thread starter Thread starter 라바
  • Start date Start date

라바

Guest
I added wpf usercontrol to winform project.
However I failed compilation.


I got errors. error CS0266: Cannot implicitly convert type 'object' to 'string'.


string abc = value; //The type of value is dynamic


I found the cause.

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:CustomControls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">


xmlns:local="clr-namespace:CustomControls" is the cause.
If xmlns:local="clr-namespace:CustomControls" is removed, I don't get error.


Why is that?

Continue reading...
 
Back
Top