{"id":17350,"date":"2021-11-19T12:28:02","date_gmt":"2021-11-19T11:28:02","guid":{"rendered":"https:\/\/ekiwi-blog.de\/?p=17350"},"modified":"2022-12-10T21:52:02","modified_gmt":"2022-12-10T20:52:02","slug":"staticextension-value-cannot-be-resolved","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/17350\/staticextension-value-cannot-be-resolved\/","title":{"rendered":"StaticExtension value cannot be resolved"},"content":{"rendered":"<p>When using Visual Studio to create a WPF application (<a title=\"XAML Get loaction of an user control in C#\" href=\"https:\/\/ekiwi.de\/en\/index.php\/4662\/c-get-position-of-usercontrol\/\" target=\"_blank\" rel=\"noopener\">XAML<\/a>), sometimes there is a problem with the WPF binding. For example, when binding resource files to make an application multilingual.<\/p>\n<p>If you want to <a title=\"WPF\/C#: binding of multiple, more than one, properties to another propertie in xaml file\" href=\"https:\/\/ekiwi-blog.de\/en\/25911\/binding-multiple-properties-with-xaml-c\/\">bind the strings to a WPF element<\/a>, then you may get the following error message:<\/p>\n<blockquote><p>StaticExtension value cannot be resolved to an enumeration, static field, or static property<\/p><\/blockquote>\n<p>Unfortunately, the error message is not very informative, so you start experimenting around and waste a lot of time.<\/p>\n<figure id=\"attachment_17347\" aria-describedby=\"caption-attachment-17347\" style=\"width: 599px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/static-extension-value-cannot-be-resolved.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-17347 size-full\" title=\"Error Message StaticExtension value can't be resolved\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/static-extension-value-cannot-be-resolved.jpg\" alt=\"Screenshot WPF application error message\" width=\"599\" height=\"197\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/static-extension-value-cannot-be-resolved.jpg 599w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/static-extension-value-cannot-be-resolved-300x99.jpg 300w\" sizes=\"auto, (max-width: 599px) 100vw, 599px\" \/><\/a><figcaption id=\"caption-attachment-17347\" class=\"wp-caption-text\">WPF application error message<\/figcaption><\/figure>\n<p>The reason why the StaticExtention value cannot be resolved is that the resource values do not have the correct<strong> Access Modifier<\/strong>. This must be set to &#8220;<em><strong>Public<\/strong><\/em>&#8221; so that the error message disappears.<\/p>\n<figure id=\"attachment_17349\" aria-describedby=\"caption-attachment-17349\" style=\"width: 615px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/static-extension-value-cannot-be-resolved-public.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-17349 size-full\" title=\"set Access Modifier to &quot;Public&quot;\" src=\"http:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/static-extension-value-cannot-be-resolved-public.jpg\" alt=\"Screenshot Visual Studio change resource file to public\" width=\"615\" height=\"191\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/static-extension-value-cannot-be-resolved-public.jpg 615w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2021\/11\/static-extension-value-cannot-be-resolved-public-300x93.jpg 300w\" sizes=\"auto, (max-width: 615px) 100vw, 615px\" \/><\/a><figcaption id=\"caption-attachment-17349\" class=\"wp-caption-text\">Switch to &#8220;Public<\/figcaption><\/figure>\n<p>If the <strong>Access Modifier<\/strong> is set to <strong>Public<\/strong>, the WPF application can be compiled again without error messages.<\/p>","protected":false},"excerpt":{"rendered":"<p>When using Visual Studio to create a WPF application (XAML), sometimes there is a problem with the WPF binding. For<\/p>\n","protected":false},"author":2,"featured_media":15712,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[1744,1742,1743,1746,1700,1745,1747],"class_list":["post-17350","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-net-en","tag-application","tag-c-en","tag-error-en","tag-programming","tag-visual-studio-en","tag-wpf-en"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/17350","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=17350"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/17350\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/15712"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=17350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=17350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=17350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}