{"id":462,"date":"2017-03-15T11:26:04","date_gmt":"2017-03-15T11:26:04","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=462"},"modified":"2017-03-29T17:38:25","modified_gmt":"2017-03-29T12:08:25","slug":"version-net-framework-launch-condition-net-framework-4","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/version-net-framework-launch-condition-net-framework-4\/","title":{"rendered":"[Solution 6 Answers] The version of the .NET Framework launch condition &#8216;.NET Framework 4&#8217; does not match the selected .NET Framework bootstrapper package"},"content":{"rendered":"<p><label class=\"label label-warning\">PROBLEM<\/label><\/p>\n<p>The error \u201cthe target version of the .NET Framework in the project does not match the .NET Framework launch condition version\u201d occurs when a C# project referring C++ through COM is built.<\/p>\n<p><label class=\"label label-info\">SOLUTION 1:<\/label><\/p>\n<p>Check the project properties for the setup and deployment project. Right click on the Setup project, select properties, go to prerequisites, and uncheck the selected .NET framework and check the required version. The same must be applied for all the projects including the setup and deployment project.<br \/>\n<label class=\"label label-info\">SOLUTION 2:<\/label><\/p>\n<p>Follow the steps below to fix the error:<\/p>\n<ul>\n<li>Open the c++ project vcxproj in a text editor<\/li>\n<li>Find &lt;TargetFrameworkVersion&gt; &lt;\/TargetFrameworkVersion&gt;<\/li>\n<li>This may need to be created under the Globals PropertyGroup<\/li>\n<li>Change to required version<\/li>\n<li>Open the project in VS<\/li>\n<li>Right click the C++ project and select properties<\/li>\n<li>Select Common Properties and confirm the version<\/li>\n<li>Select Configuration Properties -&gt; General<\/li>\n<li>Make sure the Platform Toolset is set to v90<\/li>\n<\/ul>\n[ad type=&#8221;banner&#8221;]\n<p><label class=\"label label-info\">SOLUTION 3:<\/label><\/p>\n<ul>\n<li>The error can be fixed easily by double clicking the error message.<br \/>\nA window shows up.<\/li>\n<li>Then you can modify the properties of the different elements on the page by right clicking them and selecting properties.<\/li>\n<li>Ensure that all the items on this page have the desired framework version. This works well in VS2010 version.<\/li>\n<\/ul>\n<p><label class=\"label label-info\">SOLUTION 4:<\/label><\/p>\n<p>To modify the bootstrapper, open the .csproj and manually remove the instances from it:<\/p>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Html Code<\/span> <\/div> <pre class=\"language-markup code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-markup code-embed-code\">&lt;BootstrapperPackage Include=&quot;Microsoft.Net.Client.3.5&quot;&gt;<br\/>&lt;Visible&gt;False&lt;\/Visible&gt;<br\/>&lt;ProductName&gt;.NET Framework 3.5 SP1 Client Profile&lt;\/ProductName&gt;<br\/>&lt;Install&gt;false&lt;\/Install&gt;<br\/>&lt;\/BootstrapperPackage&gt;<br\/>&lt;BootstrapperPackage Include=&quot;Microsoft.Net.Framework.3.5.SP1&quot;&gt;<br\/>&lt;Visible&gt;False&lt;\/Visible&gt;<br\/>&lt;ProductName&gt;.NET Framework 3.5 SP1&lt;\/ProductName&gt;<br\/>&lt;Install&gt;false&lt;\/Install&gt;<br\/>&lt;\/BootstrapperPackage&gt;<\/code><\/pre> <\/div>\n<p><label class=\"label label-info\">SOLUTION 5:<\/label><\/p>\n<p>Below are the steps to have a fix for this issue.<\/p>\n<ul>\n<li>select installer project<\/li>\n<li>click on the icon on top &#8220;Launch Conditions Editor&#8221;, the icon with binoculars.<\/li>\n<li>Under Launch Conditions, select &#8220;.Net framework&#8221; on the right in &#8220;Properties&#8221; select &#8220;Version&#8221; to find a drop down and change the framework to the target framework.<\/li>\n<\/ul>\n<p><label class=\"label label-info\">SOLUTION 6:<\/label><\/p>\n<p>This fix is introduced by the ClickOnce team. They say that there must be a mismatch somewhere between the launch condition of the .NET version and the selected prerequisite on the setup project&#8217;s properties. Both must point to the same framework version.<\/p>\n[ad type=&#8221;banner&#8221;]\n","protected":false},"excerpt":{"rendered":"<p>PROBLEM The error \u201cthe target version of the .NET Framework in the project does not match the .NET Framework launch condition version\u201d occurs when a C# project referring C++ through COM is built. SOLUTION 1: Check the project properties for the setup and deployment project. Right click on the Setup project, select properties, go to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3096,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[878],"tags":[885,883,884,879,881,880,882],"class_list":["post-462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-sharp","tag-net-framework-4-client-profile","tag-windows-installer-4-5-is-required-by-net-framework-3-5-sp1","tag-but-was-not-included","tag-launch-conditions-editor","tag-launch-conditions-editor-visual-studio-2015","tag-visual-studio-launch-conditions-editor","tag-windows-installer-4-5-is-required-by-microsoft-net-framework-4-x86-and-x64-but-was-not-included"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media\/3096"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}