title: How to add .Net framework prerequisite to setup install
body: <p>I have a C# WinForms project in MS Visual Studio <strong>2017</strong>. I have added a Visual Studio Installer Setup Wizard Project to create an installer for my application. This is my first time using an installer project.</p>
  
  <p>The installer correctly has a prerequisite for .Net framework 4.5.1. However, I would like to make the installer include the .Net framework installation instead of asking the user to download and install it separately at install-time (some of the users' machines don't have internet connections).</p>
  
  <p>I have already set the prerequisites to "Download prerequisites  from the same location as my application" in the Setup Property Pages, but when I build the setup I see 3 errors as follows:</p>
  
  <blockquote>
    <p>ERROR: To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'DotNetFX461\NDP461-KB3102436-x86-x64-AllOS-ENU.exe' for item 'Microsoft .NET Framework 4.6.1 (x86 and x64)' to your local machine. For more information, see <a href="http://go.microsoft.com/fwlink/?LinkId=616018" rel="noreferrer">http://go.microsoft.com/fwlink/?LinkId=616018</a>.</p>
  </blockquote>
  
  <p>The link included doesn't really help as it refers to ClickOnce installs. I <em>have</em> the mentioned NDP461 exe but I don't know where to put it. I see some other questions mention creating a bootstrapper package using the MS Bootstrapper Package Manager, but this seems to have disappeared from the internet with MS's closure of code.msdn.microsoft, with <a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/72051e64-28be-4ae5-9737-24a12b909ce3/bootstrapper-manifest-generator-no-longer-available?forum=windowsgeneraldevelopmentissues" rel="noreferrer">apparently no information on a replacement</a>. Additionally, most documentation and SO questions that I can find on the subject relate to older versions of MSVS, and do not correlate (at least not directly enough for me to figure out!) to MSVS 2017.</p>
  
  <p>How do I go about actually getting the setup project to find the exe? Do I simply need to plop it in the right location (already tried a few that were listed on various MSDN pages and under registry keys)? Or do I need to create a bootstrapper package? If the latter, is there up to date documentation on this process somewhere? Thanks!</p>
  
  <p>PS: Would the process be easier if I chose instead to use the (more recent) .Net framework that is already installed on my development machine? (I'm guessing there might be install information for that already on the machine somewhere)</p>
  
  <p><strong>Update</strong> So I tried switching to targeting .NET 4.6 instead, downloaded NDP46-KB3045557-x86-x64-AllOS-ENU.exe and placed it in the directory <code>C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX46</code>. The installer setup project now builds but gives the following warning (again, 3 of them):</p>
  
  <blockquote>
    <p>WARNING: The value of the 'PublicKey' attribute in 'Microsoft .NET Framework 4.6 (x86 and x64)' does not match that of file 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX46\NDP46-KB3045557-x86-x64-AllOS-ENU.exe'.</p>
  </blockquote>
  
  <p>I guess this means I'm <em>not</em> supposed to do it this way?</p>