This step-by-step article describes how to distribute the .NET Framework with your application.
When you deploy a Microsoft .NET-connected application, the destination computer must have the .NET Framework installed. If the .NET Framework is not installed, the application cannot run. A Microsoft Visual Studio .NET setup and deployment project does not automatically install the .NET Framework. However, there are ways to make sure that the .NET Framework is installed before your application is installed.back to the topDistribution of the .NET Framework
When you deploy Visual Studio .NET applications, the .NET Framework must be installed on the destination computer. When you create a Windows Installer setup package by using Visual Studio .NET deployment tools, the installer includes a default start condition (MsiNetAssemblySupport). This start condition verifies that the .NET Framework is installed on the destination computer. If the .NET Framework is not found on the destination computer, the installation is stopped and you receive the following error message:
This setup requires the .NET Framework. Please install the .NET Framework and run this setup again
You cannot include the .NET Framework in a Windows Installer setup package that you create by using Microsoft Visual Studio .NET deployment tools. The .NET Framework must be installed separately. You can deploy the .NET Framework on the destination computer in the following two ways:
back to the topRequirements to Install the .NET Framework
- Instruct the user to manually install the .NET Framework executable before installing the Visual Studio .NET application.
- Download the Setup.exe Bootstrap sample (available on the Microsoft Developer Network (MSDN) site). Use the Setup.exe to install the .NET Framework redistributable package (Dotnetfx.exe). After the .NET Framework is installed, this Setup.exe starts the Windows Installer package for your application.
There are basic configuration requirements that must be met to install Dotnetfx.exe. You must have one of the following operating systems and Microsoft Internet Explorer 5.01 or later installed on your computer:
- Microsoft Windows 98
- Microsoft Windows 98 Second Edition
- Microsoft Windows Millennium Edition (Windows Me)
- Microsoft Windows NT 4.0 (Workstation or Server) with Service Pack 6a
- Microsoft Windows 2000 (Professional, Server, or Advanced Server) with the latest Windows service pack and critical updates available from the Microsoft Security Web site
- Microsoft Windows XP (Home or Professional)
- Microsoft Windows Server 2003 family
Depending on your application requirements, install one (or both) of the following:
back to the topInstall the .NET Framework Manually
- MDAC 2.6 or later for data access, available from the Universal Data Access Web site
- Core WMI for Windows instrumentation, available from the Download Center
- Obtain the .NET Framework redistributable package:
- To download the .NET Framework redistributable package, visit the following Microsoft Web site:-or-
- Install the redistributable file from the Windows Component Update CD-ROM or DVD-ROM. It is located in the Wcu\dotNetFramework folder.
- Run Dotnetfx.exe to install the .NET Framework.
- If the Visual Studio .NET application requires it, you may add a start condition to the Windows Installed package to verify that MDAC version 2.6 or later is installed.
For additional information about .NET Framework Redistributable location, click the following article number to view the article in the Microsoft Knowledge Base:
308488back to the topUse Setup.exe to Distribute the .NET Framework with Your Visual Studio .NET Application
INFO: Download and Install the .NET Framework
You may want to package your application so that the .NET Framework redistributable package is installed first, and then starts the Windows Installer package (.msi file) for your Visual Studio .NET application. The Setup.exe bootstrapping application is a sample that is available on the MSDN site to demonstrate how to do this. Change the Settings file (Settings.ini) to specify the locations of the redistributable package and your application installer. For more information about how to include the .NET Framework with your package, visit the following Microsoft Web site:back to the topPrepare Your Deployment Project for Use with the Setup.exe Bootstrapping Application Sample
To use the Setup.exe bootstrapping application sample with an installer that you created by using Visual Studio .NET deployment tools, you must prepare the deployment project for this scenario to work correctly. By default, a deployment project includes a Windows Installer bootstrapping application. However, the .NET Framework redistributable also includes a Windows Installer bootstrapping application. You must remove the installer bootstrapping application from your project. To do this, follow these steps:
back to the topCustomize the Settings.ini File
- In Solution Explorer, click the deployment project.
- On the Project menu, click Properties.
- In the Property Pages dialog box, set the Bootstrapper property to None.
- On the Build menu, click Build Solution.
- Copy the Windows Installer file (.msi) to the deployment location (for example, a folder on a CD-ROM or a network share).
- Copy the Setup.exe bootstrapping application sample and the Settings.ini file that you downloaded in the "Use Setup.exe to Distribute the .NET Framework with Your Visual Studio .NET Application" section to the deployment location, and then follow the steps in the "Customize the Settings.ini File" section
back to the top
- Open the Settings.ini file in a text editor (such as Notepad).
- Locate the Msi=FxCopSourceSetup.msi entry, and then replace the default path with the path of your .msi file, as in the following examples:
- When mySetup.msi is located on the local computer in the same folder as Setup.exe, the path is Msi=mySetup.msi.
- When the mySetup.msi is located on a network share in a folder named myProjectFolder, the path is Msi=\\myNetworkShare\myProjectFolder\mySetup.msi.
- When mySetup.msi is located in a folder named myInstallerFiles, on the same CD-ROM as Setup.exe, the path is Msi=myInstallerFiles/mySetup.msi.
- Locate the FxInstallerPath=c: entry. Replace the default path with the correct path of the .NET Framework redistributable package, Dotnetfx.exe, as in the following examples:
- When Dotnetfx.exe is located on the local computer in a folder named myProjectFolder, the path is FxInstallerPath=c:\myProjectFolder\.
- When Dotnetfx.exe is located on a network share in a folder named myProjectFolder, the path is FxInstallerPath=\\myNetworkShare\myProjectFolder\.
- When Dotnetfx.exe is located in a folder named myExecutables, on the same CD-ROM as Setup.exe, the path is FxInstallerPath=myExecutables/.
- To verify what build number and language version of the .NET Framework is installed, specify the language in the Settings.ini file. By default, if you do not specify a language for the LanguageDirectory variable, Setup.exe verifies that the English version is installed.
- Save the Settings.ini file.