Click here to Skip to main content
15,798,717 members
Articles / Desktop Programming / Windows Forms

Add Prerequisites of .NET Framework in Visual Studio Setup Project

Rate me:
Please Sign up or sign in to vote.
4.70/5 (32 votes)
27 Apr 2009CPOL2 min read 169.3K   38   14
Add prerequisites of .NET Framework in Visual Studio setup project


Hi readers. This is an article for adding prerequisites of .NET Framework in Visual Studio setup project. I will only explain the steps of adding prerequisites of .NET Framework in a setup project with some pictures. 


When we develop an application using any platform, we should prepare our application to be deployed properly. Especially for .NET, the prerequisites of .NET Framework are a must. Here, I explain how to add framework to be installed before our application installation process.

After developing our .NET application, we need to create a setup project. Just follow the steps mentioned below:

  • Go to File menu, select Add New Project and then select Setup And Deployment under “Other Project Types”.


  • Give a name to your project as per your wish.


  • Then select your setup project solution and add Primary output of your developed project. You just need to right click your setup project in Solution Explorer, click add --> Project Output --> select your project.



  • Then add custom action by right clicking setup project --> view --> Custom Actions --> right click Custom Actions --> Add Custom Actions.



  • Now we are going to add the prerequisites for your setup project.
  • Select your setup project, right click and go to properties, then click the Prerequisites button.



  • Now select .NET Framework 2.0 tick box after selecting the Create setup program to install prerequisite components.
  • Then specify the install location for prerequisites by selecting the option box.


  • Here I select the second one Download prerequisites from the same location as my application.
  • Click ok and apply, then ok.
  • Now build your setup project, the .NET Framework will be added in your debug folder.


  • Go to your debug folder and see the .NET Framework folder would be added as shown below:


  • That's it.


As shown in the article, we can add the .NET Framework in our setup.


  • 28th April, 2009: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Web Developer
India India
Hi Viewers,

I wish to all. This is Vinoth. This is where I try to condense everything that you need to know about me.


visit my blog


I'm passionate about a great many things and continually learning about the things that interest me. They are wearable computers, User Interface Design, Artificial life, Industrial music.

Comments and Discussions

QuestionNice and simple explanation Pin
Arethrid2-Jan-18 0:38
Arethrid2-Jan-18 0:38 
QuestionHow to add .exe files as prerequisites in visual studio setup project Pin
Ammar Shaukat17-Dec-17 22:59
professionalAmmar Shaukat17-Dec-17 22:59 
GeneralMy vote of 5 Pin
Ammar Shaukat17-Dec-17 21:46
professionalAmmar Shaukat17-Dec-17 21:46 
QuestionSetup Project Blog Post Pin
Member 84856862-Apr-13 1:20
Member 84856862-Apr-13 1:20 
GeneralMy vote of 5 Pin
sunil Kumar Attri20-Jan-13 23:11
sunil Kumar Attri20-Jan-13 23:11 
QuestionWhy it doest not work at all with Visual Studio 2008 SP1? Pin
aaa200913-Jun-12 2:34
aaa200913-Jun-12 2:34 
Questiondecrease size of installer Pin
spydeehunk18-Apr-12 0:35
spydeehunk18-Apr-12 0:35 
i follow the steps give, but as i need my installer file must be 1 mb.And if i add .net 4.0 installer as prerequisite it does increase the size. can you tell me how i can do it
GeneralMy vote of 5 Pin
Krishna Kapadia30-Sep-10 21:49
Krishna Kapadia30-Sep-10 21:49 
GeneralMy vote of 2 Pin
Lucenty10-Sep-09 22:02
Lucenty10-Sep-09 22:02 
Questionthis is not good Pin
Oracle500718-May-09 23:37
professionalOracle500718-May-09 23:37 
QuestionPrerequiries button disabled why? Pin
Narendra Reddy Vajrala29-Apr-09 9:53
Narendra Reddy Vajrala29-Apr-09 9:53 
GeneralWhy is that?? "Download prerequisites from the same location as my application" Pin
Pablo Robert28-Apr-09 1:42
Pablo Robert28-Apr-09 1:42 
GeneralMy vote of 1 Pin
Michael Rawi27-Apr-09 21:30
Michael Rawi27-Apr-09 21:30 
GeneralRe: My vote of 1 Pin
Johnny J.27-Apr-09 22:22
professionalJohnny J.27-Apr-09 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.