Deploying C# Setup.exe with .Net 3.5 Redistributable

Its annoying for end-users when they have to download the .Net 3.5 Framework via Microsofts site when installing your applications:( So why not deploy your app with the .Net framework included!

Here are the steps to add a Setup project to your VS2008 application packaged with a .Net 3.5 installer.
1. Create a new C# .Net 3.5 project (in my case a Visual C#/Windows/Windows Forms Application).

2. Right click the project title (not the solution title), and go to Properties | Publish | Prerequisites.

  • You will see that Windows Installer and .Net 3.5 are selected as default.
  • Now, check ‘Download prerequisites from same location as my application‘.
  • This avoids the end-user have the massive .Net 3.5 Framework internet based download.
  • Make sure the ‘Create setup program to install prerequisites’ at the top of the window is checked.

3. Right click on the Solution title and go to Add | New Project | Other Project Types | Setup & Deployment. Choose Setup Wizard and then OK.

  • In the setup wizard click Next, choose the 1st option in (VS 2008), ‘Create a setup for a windows application’.
  • Next, choose the project outputs. For this example ‘Primary output from myApp’ will suffice.
  • Next, add a readme file if you want (I did not want), and click Next or Finish.

4. Right click the Setup project title (Setup3pt5 in my case, see pic below), go to Properties | Prerequisites.

  • Check ‘Download prerequisites from same location as my application’.

Setup Prerequisites

Steps 5 – 10…..
5. Under you Setup projects name, in Detected Dependencies, double click ‘Microsoft .Net Framework‘.

  • A launch conditions tab will open. Under Launch Conditions right click .Net Framework and click Properties Window.
  • In the properties window, change the InstallUrl property (initially a web address) to ‘dotNetFx35setup.exe’.

Launch Conditions

6. Build projects/solution.

7. The files you need to ship to deploy you application will be in the Debug folder in the Setup projects directory.

  • Your end-user will need all the files in the debug folder, and runs the Setup.exe.

Debug Folder files


I use Sun Microsystems Virtual Box to test my installs on different operating systems. Virtual Box allows you to run multiple virtual OS’s within your desktop.

Problem: When installing the .Net 3.5 app on a Windows XP system that already had .Net 2.0 installed I got the following error:

  • NGEN.EXE “The application failed to initialize properly (Oxc0000005). Click on OK to terminate the application.”

I had to uninstall the .Net 2.0 before the .Net 3.5 would install.

Future Work

If you want to package all the setup files and folders in a single setup.exe, you will need to use a third party install program.

I will be writing a post shortly to show you how to package all of the Visual Studio setup files and the .Net redistributables (created using the previous steps) in one setup.exe file using InstallJammer.


Tags: , , , ,

13 Responses to “Deploying C# Setup.exe with .Net 3.5 Redistributable”

  1. Roy Barina Says:

    I don’t have “Other Project Types” under “New Project”
    how do i add this to VC#2008/VC#2010?

    • bishoponvsto Says:


      I have Visual Studio 2008, and its an option on the bottom left after I go to New/Project. Check out this video and you’ll see it. Dont know why its no on your version if its 2008

  2. Lucian Says:

    Nice tut.

  3. Bhavesh Dave Says:

    Thanks It is working fine.

  4. bhaveshdave Says:

    Dear Sir,

    Thank you very much for the help to me.
    I wish to deploy my application of Visual ( 2008) with Microsoft SQL server 2008 file “.MDF”.
    Please guide me how may I deploy with all dependencies

    Please guid me.

  5. Ramendra Kumar Says:

    Hey friend i also want to add framework and sqlexpree in my window application if you have any ide plz send it to me on

  6. blogger wordpress Says:

    blogger wordpress…

    […]Deploying C# Setup.exe with .Net 3.5 Redistributable « Bishop On Development[…]…

  7. stock options trading by the numbers Says:

    What’s Happening i’m new to this, I stumbled upon this I have found It absolutely helpful and it has helped
    me out loads. I am hoping to give a contribution & aid other customers like its helped me.
    Good job.

  8. stockpair Says:

    Thanks for a marvelous posting! I really enjoyed reading it, you happen to be a great author.
    I will remember to bookmark your blog and definitely will come back down the road.
    I want to encourage continue your great job, have a nice morning!

  9. Ngen.Exe Infected Says:

    When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment
    is added I get three emails with the same comment. Is there any way you can remove people from that service?

  10. stikynot.exe.mui change font Says:

    Woah! I’m really loving the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s difficult to get
    that “perfect balance” between superb usability and visual appearance.
    I must say you have done a fantastic job with this. Additionally, the blog loads super
    fast for me on Chrome. Excellent Blog!

  11. wusa.exe /uninstall /kb Says:

    Pretty component of content. I simply stumbled
    upon your site and in accession capital to say that I get in fact loved account
    your blog posts. Anyway I will be subscribing for your feeds and
    even I success you get admission to constantly fast.

  12. sidebar.exe was is das Says:

    Hi! This is my first visit to your blog! We are a group of volunteers and starting
    a new initiative in a community in the same niche. Your blog provided
    us useful information to work on. You have done a extraordinary job!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: