How to install .NET framework 4.0 as part of installation?

后端 未结 3 684
悲哀的现实
悲哀的现实 2020-12-15 13:03

I created bootstrapper,it works but it does not install NET Framework 4.0. After the installation completed my application does not start because no NET Framework 4.0. Why

3条回答
  •  -上瘾入骨i
    2020-12-15 13:42

    All items in the item group need to have the same name, "BootstrapperFile" - currently you will have two item groups, so the .Net Framework will not be included in the bootstrapper (as it's in a different item group called "BootstrapperPackage".

    Though most examples on the net use "BootstrapperFile" or "BootstrapperPackage", the name is not significant, it just has to line up with the parameter of the bootstrapper generation task - unfortunately consistency of examples in some cases can lead to misconceptions :)

    Once corrected, the other thing to check is that when building - on both your local machine and on the build server (if you have one) that no warnings are logged - the boostrapper generation task by default will not cause the build to fail if one or more packages can't be located.

    You will see this in the msbuild logs as:

    • warning MSB3155: Item '.NETFramework,Version=v4.0' could not be located in ''.

    Easy ways to detect this is the case with your bootstrapper, are:

    1. Your generated .exe file is unusually small - say 300-400K.
    2. Delete your accompany .MSI file, then run the bootstrapper - it will generate a log file (which it provides the path to in an error message). The log file will list which packages were checked (to see if they need to be executed) - along with what was executed. If your package wasn't in the list, it's likely not in the bootstrapper.

提交回复
热议问题