{"id":3614,"date":"2014-03-29T06:53:51","date_gmt":"2014-03-29T06:53:51","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/visual-studio-dllnotfoundexception-collection-of-common-programming-errors\/"},"modified":"2014-03-29T06:53:51","modified_gmt":"2014-03-29T06:53:51","slug":"visual-studio-dllnotfoundexception-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/29\/visual-studio-dllnotfoundexception-collection-of-common-programming-errors\/","title":{"rendered":"Visual Studio DllNotFoundException-Collection of common programming errors"},"content":{"rendered":"<pre><code>    public const string LIB_GVC = \"gvc.dll\";\n    public const string LIB_GRAPH = \"graph.dll\";\n    public const int SUCCESS = 0;\n\n\n    [DllImport(LIB_GVC)]\n    public static extern IntPtr gvContext();\n<\/code><\/pre>\n<p>Later, in the main method I call gvContext() and it throws the DllNotFoundException. In my project, I have gone into the Project-&gt;Properties and set the reference paths so that I have a folder called &#8220;resources&#8221; which contains all my DLLs including gvc.dll. I thought this would do the trick but it didn&#8217;t. What do I need to do?<\/p>\n<p>Note: I cannot use Add Reference as I normally would, I realize that this behavior is normal considering Graphviz is not a C# library. I&#8217;m also a bit fuzzy on terminology, why is it called an &#8220;unmanaged DLL&#8221;? It seems to be because it wasn&#8217;t compiled from C# code but is that true\/not the whole story?<\/p>\n<p>I&#8217;m following this tutorial if it helps clarify anything.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>public const string LIB_GVC = &#8220;gvc.dll&#8221;; public const string LIB_GRAPH = &#8220;graph.dll&#8221;; public const int SUCCESS = 0; [DllImport(LIB_GVC)] public static extern IntPtr gvContext(); Later, in the main method I call gvContext() and it throws the DllNotFoundException. In my project, I have gone into the Project-&gt;Properties and set the reference paths so that I have [&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-3614","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3614","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=3614"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3614\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}