locked
Error: The version of the .NET Framework launch condition '.NET Framework 4' does not match the selected .NET Framework bootstrapper package RRS feed

  • Question

  • Hi all,

    I am getting the following warning error when building a deployment project:

    WARNING: The version of the .NET Framework launch condition '.NET Framework 4' does not match the selected .NET Framework bootstrapper package. Update the .NET Framework launch condition to match the version of the .NET Framework selected in the Prerequisites Dialog Box.

    If I change toe launch condition to '.NET Framework 2.0', then I get the following warning

    WARNING: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '.NET Framework 2.0'. Update the version of the .NET Framework launch condition to match the target version of the.NET Framework in the Advanced Compile Options Dialog Box (VB) or the Application Page (C#, F#).

    How can I modify the bootstrapper package to match the launch condition?

    I upgraded VS2008 to VS2010 recently.

    Thanks in advance!

     


    hz
    Saturday, May 8, 2010 12:42 PM

Answers

  • Finally i found where to change this settings, guys please provide steps instead of mentioning what to change.

    Here are the steps for other who still have this issue.

     

    1) select installer project

    2) click on the icon on top "Launch Conditions Editor" its the icon with a binoculars.

    3) Under Launch Conditions, Select ".Net framework" on the right in "Properties" Select "Version" you will see a drop down. change the framework to your target framework.

     

    Build and install.

     

    thanks

     

    Mehdi

    • Marked as answer by RobinDotNet Saturday, June 26, 2010 2:56 AM
    • Unmarked as answer by RobinDotNet Saturday, June 26, 2010 2:56 AM
    • Proposed as answer by RobinDotNet Saturday, June 26, 2010 2:56 AM
    • Marked as answer by Hong (MA, USA) Saturday, June 26, 2010 2:45 PM
    Friday, June 25, 2010 6:18 PM
  • Hi, hipswich,

    I just want to verify -- you ARE using a setup & deployment package, right?

    I talked to the ClickOnce team. They said the response above from sterimick is correct. You must have a mismatch somewhere between the launch condition .NET version and the selected prerequisite.

    When they say the selected prerequisite, they said it's the prerequisites button on the setup project's properties (not on the main UI project as I think I stated above).

    Can you doublecheck that?

    If you are still having a problem, can you create a small project with the problem and file a bug and post it back here, and I will bring it to their attention to take a look at. Here's where you can file a bug for VS2010/.NET 4.0: 

    https://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

    After you file the bug and save it, THEN you can attach the project to it.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Sunday, May 16, 2010 8:10 PM

All replies

  • Hi,

    What it's trying to tell you is the version of the .NET Framework that you have selected in the prerequisites does not match the Framework targeted by your project. You don't hcange the bootstrapper project, you change the prerequisite and the application's framework version to be the same.

    Double-click on the main project to bring up the property pages. Go to the publish tab. CLick on Prerequisites, and select the version of the .NET Framework that you want your application to use.

    In a C# application, go to the Application tab. There is a dropdown for the Target Framework. Change it to the same version you selected in the prerequisite box.

    In VB, go to the Compile tab. Click the button at the bottom that says 'Advanced compile options'. At the bottom of that dialog box is the target framework; change it to the same version you selected in the prerequisites box.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    • Proposed as answer by pedropablo Tuesday, May 10, 2011 5:02 PM
    Saturday, May 8, 2010 5:22 PM
  • Thanks, Robin, for the elucidation.

    I followed your instructions and changed the prerequisites to install from .Net Framework 3.5 SP1 to .Net Framework 4 (x86 and x64), but I still got the error as appended.  Then I unchecked .Net Framework (i.e. no .Net is selected), but the error remains. I rebuilt both of the main application and the deployment project. Then I unchecked the only remaining component in the prerequisite list Windows Installer 4.5 and the error persists.

    The target framework is '.Net Framework 4'. I do not understand why it looks for 'Microsoft .NET Framework 2.0'

    Any more tip will be greatly appreciated.

     

    Error:

    WARNING: The version of the .NET Framework launch condition '.NET Framework 4' does not match the selected .NET Framework bootstrapper package. Update the .NET Framework launch condition to match the version of the .NET Framework selected in the Prerequisites Dialog Box.
    WARNING: Could not find prerequisite 'Microsoft .NET Framework 2.0' in path 'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\'


    hz
    Saturday, May 8, 2010 7:04 PM
  • I get the same problem, and have been getting this or a similar problem for a long time.  I was running VS2010 RC when I posted the following:

    ref: http://social.msdn.microsoft.com/Forums/en/setupprerelease/thread/ffc93f9c-c939-4ac0-8e87-02fd4229928a

    I downloaded a TRIAL version of VS2010 release a few days ago.  The Bad Public Key went away, but I still get the 'does not match' message.  My C# application page says the "Target framework" is ".NET Framework 4 Client Profile" and the publish page prerequisites has the same checked.

    Note I did find an old forum reference (codeproject) about .NET 2.0, that said to change the properties on the project dependency for Microsoft .NET Framework.  However, in VS2010 for my project, this dependency has a blank properties page (or no properties).  So I couldn't change this THIRD place to also be consistent.

    In addition, since the automagically generated dependency reads "Microsoft .NET Framework" and doesn't say "Client Profile", I tried changing both application and publish/prerequisites pages to simply ".NET Framework 4" without "Client Profile".  This didn't help.  Still got the warning message.

     

     

    Saturday, May 8, 2010 8:55 PM
  • I had a similar problem...

    You need to make sure all of these match:

    1.  Main Project Properties - Compile Tab - Advanced Compile Options -  Target Framework

    2.  Deployment Project Properties - Prerequisites - Correct Framework checked.

    3.  Right-click on Deployment project - View - Launch Conditions.  In the Launch Condition tab, right-click the .Net Framework Launch condition, then show Properties Window.  In the Properties Window, make sure that the Version property is the correct Framework.

    If these are all set to the same framework, it 'should' work....

    Hoping this helps...

    Mike.

    • Proposed as answer by Trhacz Tuesday, May 25, 2010 11:46 PM
    Sunday, May 9, 2010 10:44 AM
  • Hi Mike, thanks for trying to help out here.

    I am wondering if I am using a different version of VS from yours.  I am using VS2010. I do not have the compile tab as you mentioned. For the first two places you mentioned, I have what Robin described in his post - Application Tab and Publish Tab. 

    I have made sure all three places have ".Net Framework 4", but I still have the following error:

    WARNING: The version of the .NET Framework launch condition '.NET Framework 4' does not match the selected .NET Framework bootstrapper package. Update the .NET Framework launch condition to match the version of the .NET Framework selected in the Prerequisites Dialog Box.

    The only way to get rid of this error is selecting "Any" for the "Version" property of .Net Framework for the Launch Condition.


    hz
    Sunday, May 9, 2010 11:57 AM
  • Hi,

    I'll ask the ClickOnce product team if they have any ideas about this. I'll report back.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Monday, May 10, 2010 11:52 PM
  • I found a solution to this.

    1.Unload the installer or solution

    2. open the .vdproj file in notepad and find the section "LaunceCondition" and update to:

     

    "FrameworkVersion" = "8:.NETFramework,Version=v4.0"

    or "FrameworkVersion" = "8:.NETFramework,Version=v4.0,Profile=Client"

     

    "LaunchCondition"

                {

                    "{-----------}

                    {

                    "Name" = "8:.NET Framework"

                    "Message" = "8:[VSDNETMSG]"

                    "FrameworkVersion" = "8:.NETFramework,Version=v4.0"

                    "AllowLaterVersions" = "11:FALSE"

                    "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000"

                    }

                }

    • Proposed as answer by Metal-Monkey Saturday, May 15, 2010 2:25 AM
    • Unproposed as answer by RobinDotNet Sunday, May 16, 2010 8:06 PM
    • Proposed as answer by Vetts360 Friday, September 14, 2018 4:40 PM
    Saturday, May 15, 2010 2:24 AM
  • Thanks for tyring to help out here. I opened the .vdproj file and found it has already had the code you suggested. 
          "LaunchCondition"
          {
            "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_7729F39BF1B648D1B7C426A868FF2394"
            {
            "Name" = "8:.NET Framework"
            "Message" = "8:[VSDNETMSG]"
            "FrameworkVersion" = "8:.NETFramework,Version=v4.0"
            "AllowLaterVersions" = "11:FALSE"
            "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=131000"
            }
          }
     
    The error persists.
    hz
    Saturday, May 15, 2010 11:08 PM
  • Hi, hipswich,

    I just want to verify -- you ARE using a setup & deployment package, right?

    I talked to the ClickOnce team. They said the response above from sterimick is correct. You must have a mismatch somewhere between the launch condition .NET version and the selected prerequisite.

    When they say the selected prerequisite, they said it's the prerequisites button on the setup project's properties (not on the main UI project as I think I stated above).

    Can you doublecheck that?

    If you are still having a problem, can you create a small project with the problem and file a bug and post it back here, and I will bring it to their attention to take a look at. Here's where you can file a bug for VS2010/.NET 4.0: 

    https://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx

    After you file the bug and save it, THEN you can attach the project to it.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Sunday, May 16, 2010 8:10 PM
  • Hallelujah!  Robin, you finally solved the problem by stating "When they say the selected prerequisite, they said it's the prerequisites button on the setup project's properties (not on the main UI project as I think I stated above)."  I found the button and changed it from .Net 2.0 to .Net 4.0 and the error is gone.

    I never seriously looked at the property page of the deployment project until I read your message.  I have been looking at the property window of the deployment project all the time (i.e. the window has properties such as Author, Description, TargetPlatform, etc.).

    Thanks a lot for all the help!


    hz
    Sunday, May 16, 2010 8:47 PM
  • Hi hipswich,

    I'm so glad it worked. I don't know much about Setup & Deployment projects. I asked the ClickOnce product team lead, and he asked the product team lead on the bootstrapper and S&D packages, who answered the question. They've been great helping me support people in this forum.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Sunday, May 16, 2010 9:46 PM
  • Yes.  Thanks a bunch.  I had the same thing going on (changed a project from 4.0 to 3.5) and I had to change the target framework on the Main UI project *and* Prerequisites on the set up project as well.
    Friday, May 21, 2010 4:01 PM
  • Finally i found where to change this settings, guys please provide steps instead of mentioning what to change.

    Here are the steps for other who still have this issue.

     

    1) select installer project

    2) click on the icon on top "Launch Conditions Editor" its the icon with a binoculars.

    3) Under Launch Conditions, Select ".Net framework" on the right in "Properties" Select "Version" you will see a drop down. change the framework to your target framework.

     

    Build and install.

     

    thanks

     

    Mehdi

    • Marked as answer by RobinDotNet Saturday, June 26, 2010 2:56 AM
    • Unmarked as answer by RobinDotNet Saturday, June 26, 2010 2:56 AM
    • Proposed as answer by RobinDotNet Saturday, June 26, 2010 2:56 AM
    • Marked as answer by Hong (MA, USA) Saturday, June 26, 2010 2:45 PM
    Friday, June 25, 2010 6:18 PM
  • He Mehdi,

    Thanks for sharing the solution.  In case it is useful, I want to point out that most likely your suggested solution addresses a similar but not identical warning as my original one.

    There are many places where .Net version has to be consistent (I do not know why this has to be the case).  Here are two of them of interest:

    1. Launch Conditions.  Your suggested steps address this place.

    2. Prerequisites. This is where my original problem came from and Robin's suggestion addresses.  Per your suggestion, let me clearly state the steps to modify the setting:

    1. Right click the Setup project in Solution Explorer and select "Properties". (Alternatively, select the Setup project and click the Properties icon on the top bar).
    2. Click button "Prerequisites...".
    3. Make sure "Create setup program to install prerequisite components" is checked and then select the appropriate .Net version in the window of prerequisites.
    4. OK -> OK.
    5. Rebuild.

    The warnings caused by mismatches of .Net version in these two places are slightly different.  The best way to see the difference is to spend a few seconds to modify the .Net version at these two places one at a time and watch the build results.

     


    hz
    • Edited by Hong (MA, USA) Thursday, July 8, 2010 11:42 AM typo
    • Proposed as answer by GoTheGoat Tuesday, January 18, 2011 5:17 AM
    Sunday, June 27, 2010 1:40 PM
  • Thanks, I'm sure people will appreciate the clarification!

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Tuesday, June 29, 2010 4:01 AM
  • Thanks. This thread helped me too. I have not gotten rid of that warning message.

    Gary Davis

    Wednesday, July 7, 2010 5:54 PM
  • Thanks!

    Worked great!

    Thursday, July 15, 2010 8:00 PM
  • I have a very similar problem, err below, but the difference is I am not working with a deployment, rather I have a Solution with a collection of projects.  One of the projects in the solution is getting this error.  When I go to the properties for that project and select the "Application" tab and change the "Target Framework" to match the "Launch Version" The problem does not go away.   The project in question is supposed to be running at .net 3.5, though most of my projects are upgraded to 4.0 this one is not.  Where is the "Launch" version stored when I am working with a Solution/Project rather than a "Deployment/project"?

    THanks.

    Warning 16 The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '3.5.21022'. Update the version of the .NET Framework launch condition to match the target version of the.NET Framework in the Advanced Compile Options Dialog Box (VB) or the Application Page (C#, F#). ..............

    Friday, July 16, 2010 7:08 PM
  • Jim, I am not sure but did you verify the consistency in Publish->Prerequisites by chance?
    hz
    Friday, July 16, 2010 10:42 PM
  • I have similar problem rebuilding a previously OK project using VC2010. I am unable to get rid of the warning: WARNING: The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '2.0.50727'. Update the version of the .NET Framework launch condition to match the target version of the.NET Framework in the Advanced Compile Options Dialog Box (VB) or the Application Page (C#, F#). I have a solution with one project generating a single .dll from C++ in /clr C++ project .vcproj contains TargetFrameworkVersion="131072" is this implicitly wanting framework 2? but C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll And another solution I have a C# project (using the .dll) and a 'setupApp' project that produces a .msi. I have found the prerequisites for both of these and both were are set to netframework 4. .csproj file contains <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> .vdproj file contains InstallerBootstrapper "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.0" "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Windows.Installer.4.5" "LaunchCondition" "FrameworkVersion" = "8:2.0.50727" <<<<<<<<<< Looks wrong???? "AllowLaterVersions" = "11:FALSE" Yet Pre-prerequisites contains Netframework 4. I clearly don't understand where the *launch* is set. Or can I edit the file, if so what version number 2.0.?.? Suggestions - please! Thanks Paul
    Paul Bristow
    Friday, November 26, 2010 2:51 PM
  • Thank you so much hipswich .

    This thread helped me too...

    Monday, January 3, 2011 3:59 PM
  • In2Minds' answer is correct if you are interested in running your application under the old .NET 2.0 framework. If your intention is to run the application under .NET 4.0 then RobinDotNet's second reply (below) explains how to set your deployment prerequsites from .NET 2.0 to .NET 4.0. Also, if you have a mixture of .NET 2.0 and .NET 4.0 assemblies in your application you can check both as a prerequisite.
    Thursday, January 20, 2011 9:24 PM
  • Hi all,

    After having this issue today too, I followed some of the advice in this post and then looked a little deeper at the actual project file configuration (.vdproj file) and located where the problem was. It seems that both Debug and Release configurations both have to be configured correctly otherwise you will get this warning. I have outlined all the steps to prevent this warning below.

    I was getting the following warning:-

    WARNING: The version of the .NET Framework launch condition '.NET Framework 4' does not match the selected .NET Framework bootstrapper package. Update the .NET Framework launch condition to match the version of the .NET Framework selected in the Prerequisites Dialog Box.

    To stop this error from occuring you need to follow the following steps to ensure eveything is targetting the same framework:-

    1. For the main project, right-click the project and go to Properties
    2. Click the Application tab and select the correct Target Framework, save and close
    3. Click on the Setup Project and open the Launch Conditions Editor
    4. Right-Click the Framework launch condition and select 'Properties Window'
    5. In the 'Version' property select the same version that you selected as the Target Framework for the main project
    6. Right-Click the Setup Project and select 'Properties'
    7. At the top you will see a 'Configuration' drop-down box, select Debug and then click on the 'Prerequisites' button
    8. Select the same framework that you selected as the 'target framework' in the main project
    9. Click Apply
    10. In the 'Configuration' drop-down box, select Release and then click on the 'Prerequisites' button
    11. Select the same framework that you selected as the 'target framework' in the main project
    12. Click Ok

    Build the setup project and the warning should now have disappeared - I found the last steps (8-12) solved my issue and saves having to directly modify the .vdproj file manually.

    NOTE: in the 'Configuration' drop-down box you do have the option of selecting 'All Configurations', however, I found that doing this and then picking the prerequisites caused Visual Studio 2010 to crash...

    Will



    Wednesday, June 22, 2011 1:48 AM
  • Thanks for the clarification. This was key to fixing my problem.  The main project(My application) has a Prerequisites... in the Application Properties/Publish section.  The installer Project also has a Prerequisites setting.  I was unaware of this Installer Project Prerequisites setting this was causing my error. 
    Tuesday, July 26, 2011 4:54 PM
  • Finally i found where to change this settings, guys please provide steps instead of mentioning what to change.

    Here are the steps for other who still have this issue.

     

    1) select installer project

    2) click on the icon on top "Launch Conditions Editor" its the icon with a binoculars.

    3) Under Launch Conditions, Select ".Net framework" on the right in "Properties" Select "Version" you will see a drop down. change the framework to your target framework.

     

    Build and install.

     

    thanks

     

    Mehdi


    Your detailed description helped me, thank you! :)
    Thursday, December 8, 2011 10:40 AM
  • I have had situations where the launch conditions matched prerequisites and the warning persisted.  These are projects that have been upgraded from Framework 2.0 and have interop references.  The most consistent way I have found to get rid of this warning is to edit the setup project directly ( *.vdproj ) and search for "LaunchCondition".  Then simply delete the configuration between the braces so it looks like this:

                "LaunchCondition"
                {
                }

    Then open the solution in VS2010, and reselect the launch conditions.  That fixes the problem.  There may be some issues with within VS 2010, where the selections in the forms match, but is not totally consistent with the info in the .vdproj file but for some reason the vdproj file is not updated on save or exit, and the warning persists.  Anyway, direct edit of the vdproj file and re-selecting the launch conditions should work.

    • Proposed as answer by ulrik s Thursday, June 28, 2012 9:15 AM
    • Unproposed as answer by ulrik s Thursday, June 28, 2012 9:15 AM
    Thursday, March 29, 2012 3:35 PM
  • I solved my challenge by making a change a 4th. place.
    If all of the above have been done and it still show the warning... Try this :)

    Check if you have another value in the PUBLISH Prerequisites!!!

    Select main project-> Properties -> Publish -> Prerequisites

    This helped me and I hope it will help others :)

    Thursday, June 28, 2012 9:22 AM
  • Thanks a lot Trhacz it works
    • Edited by Sansalk Wednesday, August 1, 2012 6:53 AM
    Wednesday, August 1, 2012 6:52 AM
  • Mehdi, thanks a lot! You've saved my day!
    Thursday, May 26, 2016 2:34 PM
  • This worked for me. The file had 4.5, but my Forms APP was 4.5.2. Updated the Launch Conditions and it removed my issue!

    Thanks!!!

    Friday, September 14, 2018 4:41 PM