{"id":537,"date":"2013-12-29T15:32:36","date_gmt":"2013-12-29T20:32:36","guid":{"rendered":"http:\/\/binaryworld.net\/blogs\/?p=537"},"modified":"2014-02-27T09:46:41","modified_gmt":"2014-02-27T14:46:41","slug":"xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context","status":"publish","type":"post","link":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/","title":{"rendered":"XAML Tips: Why do I get error &#8211; Error The name &#8216;InitializeComponent&#8217; does not exist in the current context"},"content":{"rendered":"<p>I am going to list few most annoying Errors XAML designer throws to me and hope you find right solution.<\/p>\n<p>Most likely by this time you have already gone though your error list many times and scratching your head.. why you getting nonsense errors? If that&#8217;s what you facing then first go though few checks.<\/p>\n<p>1) Make sure all dependencies are compiled properly without error.<\/p>\n<p>2) If you recently copy\/paste any files or added files as link make sure you select proper build Action. I got this error when copied linked files from one project to another. So be very careful after copy\/paste links from one project to another it will most likely change Build action (Looks like VS2012 bug ??? )<br \/>\n&#8211; Here is list of most common Build Actions<br \/>\n&#8211; For *.cs, *.vb ==> Set BuildAction=Compile<br \/>\n&#8211; For *.xaml ==> Set BuildAction=Page<br \/>\n&#8211; For Sample data file ==> Set BuildAction=DesignData or Page<br \/>\n&#8211; For Images ==> Set BuildAction=Content or Resource<br \/>\n&#8211; For any embedded font files ==> Set BuildAction=BlendEmbeddedFont , and check Project Code for <\/p>\n<p>3) Make sure you go though all errors in the list and find out any actual errors other than listed below found in the list which might be causing error.<\/p>\n<p>4) Make sure no file referenced in project with warning icon. This means you referencing something which got deleted. Check same for reference.<br \/>\nHere is list of most common errors which can be resolved by above steps.<\/p>\n<h2>Error : The name &#8220;blah-blah&#8221; does not exist in the namespace &#8220;clr-namespace:MyApp;assembly=MyApp&#8221;<\/h2>\n<h2>Error : The name &#8216;InitializeComponent&#8217; does not exist in the current context<\/h2>\n<h2>Error : The name &#8220;LocalizedStrings&#8221; does not exist in the namespace &#8220;clr-namespace:MyApp;assembly=MyApp&#8221;<\/h2>\n<p>Vote this if it helps!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am going to list few most annoying Errors XAML designer throws to me and hope you find right solution. Most likely by this time you have already gone though your error list many times and scratching your head.. why &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/\"> <span class=\"screen-reader-text\">XAML Tips: Why do I get error &#8211; Error The name &#8216;InitializeComponent&#8217; does not exist in the current context<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":488,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,61,80,26,56,74],"tags":[81,82],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>XAML Tips: Why do I get error - Error The name &#039;InitializeComponent&#039; does not exist in the current context - BinaryWorld Blog<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"XAML Tips: Why do I get error - Error The name &#039;InitializeComponent&#039; does not exist in the current context - BinaryWorld Blog\" \/>\r\n<meta property=\"og:description\" content=\"I am going to list few most annoying Errors XAML designer throws to me and hope you find right solution. Most likely by this time you have already gone though your error list many times and scratching your head.. why &hellip; XAML Tips: Why do I get error &#8211; Error The name &#8216;InitializeComponent&#8217; does not exist in the current context Read More &raquo;\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/\" \/>\r\n<meta property=\"og:site_name\" content=\"BinaryWorld Blog\" \/>\r\n<meta property=\"article:published_time\" content=\"2013-12-29T20:32:36+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2014-02-27T14:46:41+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png\" \/>\r\n\t<meta property=\"og:image:width\" content=\"167\" \/>\r\n\t<meta property=\"og:image:height\" content=\"167\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\r\n<meta name=\"author\" content=\"Binary World\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Binary World\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/\",\"url\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/\",\"name\":\"XAML Tips: Why do I get error - Error The name 'InitializeComponent' does not exist in the current context - BinaryWorld Blog\",\"isPartOf\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png\",\"datePublished\":\"2013-12-29T20:32:36+00:00\",\"dateModified\":\"2014-02-27T14:46:41+00:00\",\"author\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0\"},\"breadcrumb\":{\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#primaryimage\",\"url\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png\",\"contentUrl\":\"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png\",\"width\":\"167\",\"height\":\"167\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/binaryworld.net\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"XAML Tips: Why do I get error &#8211; Error The name &#8216;InitializeComponent&#8217; does not exist in the current context\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#website\",\"url\":\"https:\/\/binaryworld.net\/blogs\/\",\"name\":\"BinaryWorld Blog\",\"description\":\"Tips and Tutorials for Microsoft SQL Server, SSIS, SSAS, Business Intelligence, C#, .net\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/binaryworld.net\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0\",\"name\":\"Binary World\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g\",\"caption\":\"Binary World\"},\"description\":\"Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.\",\"url\":\"https:\/\/binaryworld.net\/blogs\/author\/admin\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"XAML Tips: Why do I get error - Error The name 'InitializeComponent' does not exist in the current context - BinaryWorld Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/","og_locale":"en_US","og_type":"article","og_title":"XAML Tips: Why do I get error - Error The name 'InitializeComponent' does not exist in the current context - BinaryWorld Blog","og_description":"I am going to list few most annoying Errors XAML designer throws to me and hope you find right solution. Most likely by this time you have already gone though your error list many times and scratching your head.. why &hellip; XAML Tips: Why do I get error &#8211; Error The name &#8216;InitializeComponent&#8217; does not exist in the current context Read More &raquo;","og_url":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/","og_site_name":"BinaryWorld Blog","article_published_time":"2013-12-29T20:32:36+00:00","article_modified_time":"2014-02-27T14:46:41+00:00","og_image":[{"width":"167","height":"167","url":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png","type":"image\/png"}],"author":"Binary World","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Binary World","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/","url":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/","name":"XAML Tips: Why do I get error - Error The name 'InitializeComponent' does not exist in the current context - BinaryWorld Blog","isPartOf":{"@id":"https:\/\/binaryworld.net\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#primaryimage"},"image":{"@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#primaryimage"},"thumbnailUrl":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png","datePublished":"2013-12-29T20:32:36+00:00","dateModified":"2014-02-27T14:46:41+00:00","author":{"@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0"},"breadcrumb":{"@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#primaryimage","url":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png","contentUrl":"https:\/\/binaryworld.net\/blogs\/wp-content\/uploads\/2013\/11\/xaml.png","width":"167","height":"167"},{"@type":"BreadcrumbList","@id":"https:\/\/binaryworld.net\/blogs\/xaml-tips-why-do-i-get-error-error-the-name-initializecomponent-does-not-exist-in-the-current-context\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/binaryworld.net\/blogs\/"},{"@type":"ListItem","position":2,"name":"XAML Tips: Why do I get error &#8211; Error The name &#8216;InitializeComponent&#8217; does not exist in the current context"}]},{"@type":"WebSite","@id":"https:\/\/binaryworld.net\/blogs\/#website","url":"https:\/\/binaryworld.net\/blogs\/","name":"BinaryWorld Blog","description":"Tips and Tutorials for Microsoft SQL Server, SSIS, SSAS, Business Intelligence, C#, .net","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/binaryworld.net\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/77cf0a9a512dd22bff93c6a1b6374fe0","name":"Binary World","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/binaryworld.net\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eaea47799daa577835eb53e64dfd3e13?s=96&d=mm&r=g","caption":"Binary World"},"description":"Binary World is a Software Development company located in Atlanta, USA (since 2007). Binary World specialized in Business Intelligence, mobile, cloud computing and .Net Application Development.","url":"https:\/\/binaryworld.net\/blogs\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts\/537"}],"collection":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/comments?post=537"}],"version-history":[{"count":0,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/posts\/537\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/media\/488"}],"wp:attachment":[{"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/media?parent=537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/categories?post=537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/binaryworld.net\/blogs\/wp-json\/wp\/v2\/tags?post=537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}