4

I installed the 4.5.2 .NET Framework (from 4.0 previously), and it everything told me that things were peachy. It told me to restart, so restart I did.

I was able develop/run the app through VS, using classes only available in 4.5 & up so I know that something was installed properly.

However, when I create an installer (Setup Project - Visual Studio Installer) and try to run the installer on my machine... I get this message box:

Error when targeting 4.5 OR 4.5.2 and trying to run the msi.

Basically I have tried everything under the sun, including running the repair from the installer for .NET 4.5.2, running the framework repair tool from Microsoft (with a restart after as well), and I tried doing some registry things that I found online. Nothing works, and quite frankly, I am a bit ticked off.

Launch Conditions of Installer:
launch conditions

Installer Prerequisites: enter image description here

If anyone could give me some insight, that would be greatly appreciated. I have never upgraded .NET frameworks in the past, so I have no idea what I am doing apparently.

Thank you.

UPDATE:

Still no resolution - but I was able to get the program installed. However, it is only because I changed the prerequisites of the installer to only require .NET 4.0. I get a couple warnings and such when I compile, but the program (once installed) runs perfectly fine, even the parts of it that use .NET 4.5 features.

I also followed the steps on MSDN that show you what versions are installed in the Registry, and 4.5.51209 IS in there. Essentially it is working, but I still think there is a better way/I am missing something.

overslacked
  • 4,127
  • 24
  • 28
efischency
  • 473
  • 2
  • 14
  • 2
    Clearly you need to tell us a lot more about the installer you created. What kind of tool you used, what prerequisites you selected, what happens when you let it progress, at least. – Hans Passant Apr 10 '15 at 17:37
  • Visual Studio Installer (Setup Project) is the installer I created, I only have the 4.5 prerequisite selected. When it does prompt me I can choose yes or no. If yes, brings me to the website to download the .NET installer, which is the exact same one that I already have. if no, it stops and nothing happens. @hans passant I appreciate the help, but I will not be able to continue for an hour or so because I need to go se mortgage officer right now. I will be back though. – efischency Apr 10 '15 at 17:49
  • Is there anything else that I can supply that might help @HansPassant? – efischency Apr 10 '15 at 19:39
  • Did you "change the target framework in all the necessary spots" by downloading the developer pack, going into each project's properties, and changing the framework using the dropdown list? You may want to revert and do it that way if you didn't. Just changing the targetFramework property in the config is usually looking for trouble. If you retargeted it the standard way, how are your project files looking? You might have old stuff hanging around in there still. – moarboilerplate Apr 10 '15 at 21:30
  • 2
    Very little of the detail in your question (most importantly the tags) make it obvious that your problem is with the results of a Visual Studio installation project. Editing to remove unnecessary information, and include more details / a screenshot of the setup project's prerequisites, would help. – overslacked Apr 10 '15 at 21:52
  • @moarboilerplate I changed the target framework in the project properties like shown here: [here](https://msdn.microsoft.com/en-us/library/bb398202.aspx), then in the installer launch conditions, and also in the installer prerequisites. If there is another way to do this, then by all means I will try it. – efischency Apr 10 '15 at 22:07
  • @overslacked I am sorry that you don't like the format of my question, I appreciate the feeback. I will get some screenshots up and get rid of some of the fluff. I am fairly new to actually asking questions on SO, so I am doing what I can to do it properly. – efischency Apr 10 '15 at 22:09
  • @overslacked is that better? – efischency Apr 10 '15 at 22:22
  • @efischency, much improved! It's now very easy to tell that you appear to have done everything correctly, which is both good and bad.... – overslacked Apr 10 '15 at 23:15
  • 2
    Hmm, where did the bootstrapper come from? .NET 4.5.2 shipped after VS2013 and was never covered by the updates. [Check this](https://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx) for the version check. And avoid targeting 4.5.2, always favor 4.5 – Hans Passant Apr 10 '15 at 23:20
  • @HansPassant Good to know about the targeting practice, thanks. If by 'bootstrapper' you mean the installer package, I got it from [Here](http://blogs.msdn.com/b/visualstudio/archive/2014/04/17/visual-studio-installer-projects-extension.aspx). And also, that website you said to check the version with is the one that I used... based on that, 4.5 is most definitely installed on my machine. – efischency Apr 10 '15 at 23:41
  • No, not that one. A bootstrapper is a "package" that's installed in the Windows SDK directory. Installed bootstrappers appear in the Prerequisites list. I'm 95% sure that there isn't one for 4.5.2, only a ClickOnce version was published and you are not using ClickOnce. – Hans Passant Apr 10 '15 at 23:58

2 Answers2

0

The .NET 4.5.2 framework is an in place upgrade, so the new libraries should be available after installing it. However, it seems you are still targeting the .NET 4.5.0 framework instead of 4.5.2 and that version is not installed on your machine. If you recompile your project and msi installer against version 4.5.2 the error should go away.

Alex
  • 21,273
  • 10
  • 61
  • 73
  • I think that I have tried this already, but I will do so again. It won't be for an hour or so though. Thank you for helping though! – efischency Apr 10 '15 at 17:50
  • I just did this again, and no luck. It is telling me "This setup requires the .NET Framework version 4.5. Please install the .NET Framework and run this setup again." - I even tried to install the 4.5 one by itself, but it says that there is a newer version already installed. I tried using the msi I used to install 4.5.2 and it says I cannot do so. This is fun. – efischency Apr 10 '15 at 19:22
0

I ran into the same issue. Open up the Setup project in the VS IDE and you will find a 'Launch Conditions Editor' in the Solution explorer. Click that and you will see a '.Net Framework'. Change it's Version property to the intended target framework. In my case, the only option that really worked was setting it to 'Any'. Good luck!

Dee
  • 103
  • 7