c# - The tag 'Employee' does not exist in XML namespace 'clr-namespace:XYZ;assembly=XYZ' -


i trying out simple wpf application. xaml code is:

<window x:class="wpfapplication1.mainwindow"         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"         xmlns:sys="clr-namespace:system;assembly=mscorlib"         xmlns:local="clr-namespace:wpfapplication1;assembly=wpfapplication1"         title="my first wpf demo" height="350" width="525">     <window.resources>         <sys:int32 x:key="i">10</sys:int32>         <local:employee x:key="emp2"></local:employee> --> line     </window.resources>     <stackpanel>         <textbox x:name="txtname" fontsize="18" margin="20"></textbox>         <button x:name="btnclickme" fontsize="18" margin="20"                  click="btnclickme_click">click me</button>         <textblock x:name="lblname" fontsize="18" margin="20"></textblock>         <label x:name="lblempinfo" fontsize="18" margin="20"></label>         <label x:name="lblempinfo2" fontsize="18" margin="20"></label>     </stackpanel> </window> 

i have class employee follows in same project:

using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks;  namespace wpfapplication1 {     public class employee     {         public int id { get; set; }         public string name { get; set; }     } } 

when try build project error:

error 1 tag 'employee' not exist in xml namespace 'clr-namespace:wpfapplication1;assembly=wpfapplication1'. line 9 position 10.

haven't checked, but... have tried removing assembly=wpfapplication1 part? leaving xmlns:local="clr-namespace:wpfapplication1"


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -