Oct 26, 2012

When the VS Setup Wizard doesn't get the .NET client right

When I use the Setup and Deployment Wizard project, it never manages to match the .NET Framework I have selected.  I get the following warning:

Warning    2    The target version of the .NET Framework in the project does not match the .NET Framework launch condition version '.NET Framework 4 Client Profile'. 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 suppose if I used just the .NET Framework Client Profile, it would work, but I usually pick the .NET Framework .  I've talked about using this installer in two previous posts, one that covered the basics, and one that covered some more advanced concepts. With a little luck the third time is the charm.

The fix for this warning is fairly easy to implement once you know where to look.  First open the properties for your installer project by right-clicking on the project in the Solution Explorer. You should get the following dialog:

SNAGHTML10b1328cClicking the Prerequisites… Button will get you another dialog

 

SNAGHTML10b1bb2bMake sure the items clicked here match what you selected on your main project Verify by right-clicking on your main project, select the Application Tab (the top one) and look at the Target framework: popup selection.

But you're not done yet.

imageThe final piece of the puzzle requires that you right-click on your installer project again and this time use the  View Menu and select the Launch Conditions option. That window will open in the content area.

Select the .NET Framework as shown; and then in the properties pane use the popup for Version and select the matching .NET Framework. Rebuild and Bob's your uncle.

About Me

My photo
Tod Gentille (@todgentille) is now a Curriculum Director for Pluralsight. He's been programming professionally since well before you were born and was a software consultant for most of his career. He's also a father, husband, drummer, and windsurfer. He wants to be a guitar player but he just hasn't got the chops for it.