Recently, after you create your application (web or windows app) in VS .Net 2008 / 2010 of course you create your setup project / click once deployment for better distribution of your application. But we will found a problem if we want to include .Net Framework 3.5 SP1 as our prerequisites in the same directory as the application. You will found error message like this one : “The install location for prerequisites has not been set to ‘component vendor’s web site’ and the file ‘DotNetFX35SP1\dotNetFX20\netfx20a_x86.msi’ in item ‘.NET Framework 3.5 SP1‘ can not be located on disk.”. Well, it’s because by default, .Net Framework 3.5 SP1 will be download from Microsoft Download Center website due to size restrictions.
The question is, how we include .Net Framework 3.5 SP1 in our installation package? well, Microsoft has provided way to doing this. You can find the full instruction in Visual Studio 2008 Service Pack 1 Readme.
I will try to provide tutorial based on VS 2008 SP1 Readme file. Here’s the step :
- Download .Net Framework 3.5 SP1 from Microsoft Download Center.
- Open command prompt and navigate to your downloaded .Net Framework path. For example : C:\dotNetFx35.exe
- At the command prompt, type dotNetFx35.exe /X: this will extracted Framework files to a folder named WCU in your current directory.
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
for x86 os
C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
for x64 OS.
- Edit the product.xml with notepad or other text editor tool.
- Paste this following into <PackageFiles> element :
- Find the element for <PackageFile Name=”dotNetFX30\XPSEPSC-x86-en-US.exe” and change the PublicKey value to:
- Find the element for <PackageFile Name=”dotNetFX30\XPSEPSC-amd64-en-US.exe” and change the PublicKey value to the same as in step 7 above.
- save the product.xml.
- Open your extracted dotNetFx35.exe files, and copy all of contents in C:\wcu\dotNetFramework to folder in step 4.
Note : For VS 2010, you just go to this folder
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
for x86 OS and
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
for x64 OS. Rest of it is the same.
That’s it. Now you can include .Net Framework 3.5 SP1 in your installation package.