{"id":283,"date":"2016-04-29T10:49:05","date_gmt":"2016-04-29T09:49:05","guid":{"rendered":"http:\/\/babbacom.com\/?p=283"},"modified":"2016-04-29T16:07:56","modified_gmt":"2016-04-29T15:07:56","slug":"xamarin-forms-error-cs0117","status":"publish","type":"post","link":"https:\/\/babbacom.com\/?p=283","title":{"rendered":"Xamarin.Forms Error CS0117"},"content":{"rendered":"<p>Now that I have completed the first release of Mobile DMX I thought would convert the project over from Xamarin Studio to Visual Studio. I wasn&#8217;t able to do this until recently because I have an &#8220;Indie Android&#8221; licence, which meant I had to use Xamarin Studio, but since MS have bought Xamarin I can now use Visual Studio (Xamarin Studio is deprecated), which is good.<\/p>\n<p>Took a while, though. At first I was getting several hundred errors of the form<\/p>\n<pre>error CS0117: 'Resource.Attribute' does not contain a definition for 'mediaRouteSettingsDrawable'\r\n<\/pre>\n<p><!--more-->Tracing these back led to lines like<\/p>\n<pre>global::NControl.Droid.Resource.Attribute.mediaRouteSettingsDrawable = global::Babbacombe.MobileDmx.Android.Resource.Attribute.mediaRouteSettingsDrawable;<\/pre>\n<p>in Resource.designer.cs referring to <a href=\"https:\/\/github.com\/chrfalch\/NControl\">NControl<\/a> and <a href=\"https:\/\/github.com\/XLabs\/Xamarin-Forms-Labs\">XLabs<\/a>.<\/p>\n<p>Resource.designer.cs is auto-generated at each build, so there was nothing I could do to edit the problems out.<\/p>\n<p>Took some sorting out, but the main problem is that the versions of these libraries in Nuget have been built against earlier versions of Xamarin.Forms.<\/p>\n<p>It looks like the earlier version puts a lot of resource entries in that aren&#8217;t in the current version, and this causes problems when the app tries to overwrite the default values put in by the library with values that it hasn&#8217;t generated.<\/p>\n<p>The only fix I could find was to fork these libraries myself, build them with the same versions of the libraries and Android target, and use my builds in the app.<\/p>\n<p>The whole mechanism looks very clunky. Apart from wondering why the app has to overwrite values that were filled in in the library when it was built, I wonder why they didn&#8217;t use reflection, or a lookup into a dll, rather than generating and compiling this rather large resource file. I suppose it looked like the easiest way to do it at the time.<\/p>\n<p>I do hope they don&#8217;t break compatibility like that again, but looking back through the Xamarin forum this seems to be a regular problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that I have completed the first release of Mobile DMX I thought would convert the project over from Xamarin Studio to Visual Studio. I wasn&#8217;t able to do this until recently because I have an &#8220;Indie Android&#8221; licence, which meant I had to use Xamarin Studio, but since MS have bought Xamarin I can &hellip; <a href=\"https:\/\/babbacom.com\/?p=283\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Xamarin.Forms Error CS0117&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,7,1,11],"tags":[41],"class_list":["post-283","post","type-post","status-publish","format-standard","hentry","category-android","category-programming","category-uncategorized","category-windows","tag-xamarin"],"_links":{"self":[{"href":"https:\/\/babbacom.com\/index.php?rest_route=\/wp\/v2\/posts\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/babbacom.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/babbacom.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/babbacom.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/babbacom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283"}],"version-history":[{"count":4,"href":"https:\/\/babbacom.com\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/babbacom.com\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions\/287"}],"wp:attachment":[{"href":"https:\/\/babbacom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/babbacom.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/babbacom.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}