{"id":4672,"date":"2014-03-30T14:30:01","date_gmt":"2014-03-30T14:30:01","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-can-i-reference-a-dll-regardless-of-version-collection-of-common-programming-errors\/"},"modified":"2014-03-30T14:30:01","modified_gmt":"2014-03-30T14:30:01","slug":"how-can-i-reference-a-dll-regardless-of-version-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/how-can-i-reference-a-dll-regardless-of-version-collection-of-common-programming-errors\/","title":{"rendered":"How can I reference a DLL regardless of version?-Collection of common programming errors"},"content":{"rendered":"<p>Okay, I am a heavy user of Telerik&#8217;s library of controls, specifically for ASP.NET. However, there is a small bit of functionality which I wanted to add to some of the controls. Nowadays I can do this easy enough using Extension methods. So I wrote a small library which does exactly that. Obviously, this library needs to reference their DLL (<code>Telerik.Web.UI.dll<\/code>).<\/p>\n<p>In the <code>My Project &gt; References<\/code> page of my DLL project, I have a reference to <code>Telerik.Web.UI.dll<\/code>. For this reference, I have the <strong>Specific Version<\/strong> property set to False, because I don&#8217;t want my library to care about what version of the Telerik DLL is being used. THIS is my problem though&#8230; the .NET compiler doesn&#8217;t seem to honor this setting.<\/p>\n<p>Case in point, I have a website which references both the Telerik DLL and mine. I updated the Telerik library to the latest version. Now when I try to run my website, I get:<\/p>\n<p><code>Could not load file or assembly 'Telerik.Web.UI, Version=2012.1.215.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)<\/code><\/p>\n<p>I fix this by going to my DLL project, recompiling it against the latest Telerik DLL, and then updating my DLL in the website. This is precisely what i <em>didn&#8217;t<\/em> want to have to do every time I update Telerik&#8217;s library. I <strong><em>thought<\/em><\/strong> that setting <strong>Specific Version<\/strong> to false would mean it would work with any version. No? Or am I <strong><em>completely<\/em><\/strong> misunderstanding what that setting does?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Okay, I am a heavy user of Telerik&#8217;s library of controls, specifically for ASP.NET. However, there is a small bit of functionality which I wanted to add to some of the controls. Nowadays I can do this easy enough using Extension methods. So I wrote a small library which does exactly that. Obviously, this library [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4672","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4672"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4672\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}