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
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:
Easy ways to detect this is the case with your bootstrapper, are: