{"id":4793,"date":"2023-01-08T12:32:53","date_gmt":"2023-01-08T11:32:53","guid":{"rendered":"https:\/\/ekiwi.de\/index.php\/4793\/visual-studio-referenzen-konnte-nicht-gefunden-werden\/"},"modified":"2023-01-08T13:20:15","modified_gmt":"2023-01-08T12:20:15","slug":"visual-studio-referenced-component-could-not-be-found","status":"publish","type":"post","link":"https:\/\/ekiwi.de\/en\/index.php\/4793\/visual-studio-referenced-component-could-not-be-found\/","title":{"rendered":"Visual Studio: The referenced component could not be found"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of content<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/ekiwi.de\/en\/index.php\/4793\/visual-studio-referenced-component-could-not-be-found\/#Error_messages\" >Error messages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/ekiwi.de\/en\/index.php\/4793\/visual-studio-referenced-component-could-not-be-found\/#Solution_1_Update_references\" >Solution 1: Update references<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/ekiwi.de\/en\/index.php\/4793\/visual-studio-referenced-component-could-not-be-found\/#Solution_2_Set_Specific_Version_to_False\" >Solution 2: Set Specific Version to False<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/ekiwi.de\/en\/index.php\/4793\/visual-studio-referenced-component-could-not-be-found\/#Solution_3_Manually_uninstall_and_reinstall_packages\" >Solution 3: Manually uninstall and reinstall packages<\/a><\/li><\/ul><\/nav><\/div>\n<p>I often have the problem that in Visual Studio suddenly the references (referenced libraries) are no longer available. This usually occurs when I have comitted the VS project via git and want to continue working on another computer. This also occurs when, for example, my colleague has continued to work on a project and I then fetch the latest version via git using a pull request. In most cases, the previous cause is that an update has been made for the integrated libraries, such as Telerik, and now the version levels that are stored in the <em>*.cproj<\/em> file differ with the installed versions.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Error_messages\"><\/span>Error messages<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The whole thing then manifests itself in the error message when compiling:<\/p>\n<blockquote><p>\u201eThe referenced component \u201a[\u2026]\u2018 could not be found.\u201c<\/p><\/blockquote>\n<figure id=\"attachment_4781\" aria-describedby=\"caption-attachment-4781\" style=\"width: 500px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4781 size-full\" src=\"\/wp-content\/uploads\/2023\/01\/visual-studio-the-referenced-component-could-not-be-found.jpg\" alt=\"Screenshot Error List of Visual Studio with error message: The referenced component ... could not be found\" width=\"500\" height=\"187\" srcset=\"\/wp-content\/uploads\/2023\/01\/visual-studio-the-referenced-component-could-not-be-found.jpg 500w, \/wp-content\/uploads\/2023\/01\/visual-studio-the-referenced-component-could-not-be-found-300x112.jpg 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><figcaption id=\"caption-attachment-4781\" class=\"wp-caption-text\">error message<\/figcaption><\/figure>\n<p>And if you look in the <em>Solution Explorer<\/em> under the project under References, you will see the references in question with a <strong>yellow triangle and exclamation mark<\/strong> in the icon.<\/p>\n<figure id=\"attachment_4789\" aria-describedby=\"caption-attachment-4789\" style=\"width: 480px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4789 size-full\" src=\"\/wp-content\/uploads\/2023\/01\/visual-studio-references-not-available.jpg\" alt=\"Screenshot Visual Studio Solution Explorer with yellow triangle and exclamation mark at references\" width=\"480\" height=\"650\" srcset=\"\/wp-content\/uploads\/2023\/01\/visual-studio-references-not-available.jpg 480w, \/wp-content\/uploads\/2023\/01\/visual-studio-references-not-available-222x300.jpg 222w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><figcaption id=\"caption-attachment-4789\" class=\"wp-caption-text\">References not found in Solution Explorer<\/figcaption><\/figure>\n<p>If you take a closer look at the properties of the references, you can see that all affected references have the property &#8220;<em>Specific Version<\/em>&#8221; set to True and the property is <strong>version 0.0.0.0<\/strong>.<\/p>\n<figure id=\"attachment_4787\" aria-describedby=\"caption-attachment-4787\" style=\"width: 350px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4787 size-full\" src=\"\/wp-content\/uploads\/2023\/01\/visual-studio-properties-references-version-0.0.0.0.jpg\" alt=\"Screenshot Visual Studio Properties window with assembly version 0.0.0.0\" width=\"350\" height=\"279\" srcset=\"\/wp-content\/uploads\/2023\/01\/visual-studio-properties-references-version-0.0.0.0.jpg 350w, \/wp-content\/uploads\/2023\/01\/visual-studio-properties-references-version-0.0.0.0-300x239.jpg 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><figcaption id=\"caption-attachment-4787\" class=\"wp-caption-text\">Package version is 0.0.0.0 in <a href=\"https:\/\/ekiwi.de\/en\/index.php\/5167\/visual-studio-create-method-from-selected-code-lines-refactoringredesign\/\" title=\"Visual Studio: Create method from selected code lines (refactoring\/redesign)\">Visual Studio<\/a><\/figcaption><\/figure>\n<p>So this can&#8217;t be. Something cannot be right here. This is annoying and eats up unnecessary time that you would rather spend programming.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Solution_1_Update_references\"><\/span>Solution 1: Update references<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One solution is to update all references. To save time and work I tried it first via the <strong>Package Manager Console<\/strong>. And there I inserted the following command:<\/p>\n<pre>PM&gt; Update-Package<\/pre>\n<p>If the <em>Package Manager Console<\/em> is not displayed, you can access it via <em>&#8220;View&#8221; \u27a4 &#8220;Other Views&#8221; \u27a4 &#8220;Package Manager Console&#8221;<\/em>.<\/p>\n<figure id=\"attachment_4785\" aria-describedby=\"caption-attachment-4785\" style=\"width: 648px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4785 size-full\" src=\"\/wp-content\/uploads\/2023\/01\/visual-studio-package-manager-console.jpg\" alt=\"Screenshot Package Manager Console in Visual Studio\" width=\"648\" height=\"128\" srcset=\"\/wp-content\/uploads\/2023\/01\/visual-studio-package-manager-console.jpg 648w, \/wp-content\/uploads\/2023\/01\/visual-studio-package-manager-console-300x59.jpg 300w\" sizes=\"auto, (max-width: 648px) 100vw, 648px\" \/><figcaption id=\"caption-attachment-4785\" class=\"wp-caption-text\">Update Packages with Package Manager Console<\/figcaption><\/figure>\n<p>Some references were updated and are now available. But unfortunately not all of them. By and large, the problem remains.<\/p>\n<p>As a second attempt I then tried the following command,<\/p>\n<pre>PM&gt; Update-Package -Reinstall<\/pre>\n<p>which uninstalls the Nuget references and then reinstalls them. Unfortunately, this also did not lead to the desired success. Many references were removed, but not reinstalled.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Solution_2_Set_Specific_Version_to_False\"><\/span>Solution 2: Set Specific Version to False<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Another solution can be to set the property &#8220;<em>Specific Version<\/em>&#8221; to <em><strong>False<\/strong> <\/em>in the properties of the affected refreces.<\/p>\n<figure id=\"attachment_4791\" aria-describedby=\"caption-attachment-4791\" style=\"width: 350px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4791 size-full\" src=\"\/wp-content\/uploads\/2023\/01\/visual-studio-specific-version-to-false.jpg\" alt=\"Screenshot Visual Studio Properties-Window\" width=\"350\" height=\"340\" srcset=\"\/wp-content\/uploads\/2023\/01\/visual-studio-specific-version-to-false.jpg 350w, \/wp-content\/uploads\/2023\/01\/visual-studio-specific-version-to-false-300x291.jpg 300w\" sizes=\"auto, (max-width: 350px) 100vw, 350px\" \/><figcaption id=\"caption-attachment-4791\" class=\"wp-caption-text\">Set specific version to &#8220;False&#8221;<\/figcaption><\/figure>\n<p>For some of the affected references this worked. They lost the yellow triangle with exclamation mark. Unfortunately, this procedure did not work for all references.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Solution_3_Manually_uninstall_and_reinstall_packages\"><\/span>Solution 3: Manually uninstall and reinstall packages<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If all else fails, the less refreshing and tedious solution is to manually uninstall the individual packages via the <em>NuGet Package Manager<\/em> and then reinstall them.<\/p>\n<p>If you have already done the Update-Package -Reinstall before, you may only have to reinstall because the packages in question are already uninstalled.<\/p>\n<figure id=\"attachment_4777\" aria-describedby=\"caption-attachment-4777\" style=\"width: 650px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-4777 size-full\" src=\"\/wp-content\/uploads\/2023\/01\/visual-studio-found-conflicts-between-different-versions-of-assembly-component.jpg\" alt=\"Visual Studio: Found conflicts between different versions of packages\" width=\"650\" height=\"292\" srcset=\"\/wp-content\/uploads\/2023\/01\/visual-studio-found-conflicts-between-different-versions-of-assembly-component.jpg 650w, \/wp-content\/uploads\/2023\/01\/visual-studio-found-conflicts-between-different-versions-of-assembly-component-300x135.jpg 300w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><figcaption id=\"caption-attachment-4777\" class=\"wp-caption-text\">Reinstall component via NuGet Package Manager<\/figcaption><\/figure>\n<p>You can start the <em>NuGet Package Manager<\/em> by right-clicking on the project and selecting &#8220;<em>Manage NuGet Packages&#8230;<\/em>&#8220;. Or you can go to the menu via <em>&#8220;Tools \u27a4 &#8220;Nuget Package Manager&#8221; \u27a4 &#8220;Manage NuGet Packages for Solution&#8221;<\/em>.<\/p>\n<p>Unfortunately, new unexpected problems can occur when reinstalling the packages. For example, I received an error message of the type:<\/p>\n<blockquote><p><a href=\"https:\/\/ekiwi.de\/en\/index.php\/4779\/visual-studio-found-conflicts-between-different-versions-of-assembly\/\">Found conflicts between different versions of &#8220;assembly&#8221; that could not be resolved.<\/a><\/p><\/blockquote>\n<p>Only a downgrade of the conflicting package to a supported version will help.<\/p>","protected":false},"excerpt":{"rendered":"<p>I often have the problem that in Visual Studio suddenly the references (referenced libraries) are no longer available. This usually<\/p>\n","protected":false},"author":2,"featured_media":3616,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[870,859],"tags":[875],"class_list":["post-4793","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming","category-uncategorized","tag-visual-studio-en"],"_links":{"self":[{"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/posts\/4793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/comments?post=4793"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/posts\/4793\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/media\/3616"}],"wp:attachment":[{"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/media?parent=4793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/categories?post=4793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi.de\/en\/index.php\/wp-json\/wp\/v2\/tags?post=4793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}