Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a c# project on windows 7

Tags:

c#

windows-7

If I compile a simple(no additional libraries or assemblies) c# application, can I assume it will run on any new windows 7 machine natively or do I have to worry about end users having .Net or other libraries installed?

like image 776
alex Avatar asked Dec 06 '22 00:12

alex


2 Answers

Windows 7 includes the .NET Framework 3.5.1 as an OS component.

This means you will get:

  • .NET Framework 2.0 SP2
  • 3.0 SP2
  • 3.5 SP1
  • some post 3.5 SP1 bug fixes

However, if you're using newer versions of .NET, and if you're using libraries that don't get shipped with the above, then you still need to consider packaging these up in an MSI/installer.

This page on Wikipedia has a good summary:

http://en.wikipedia.org/wiki/.NET_Framework#Versions

If this is anything more than a "quick and dirty" app, or unless you work in an area where you know exactly what the target machines look like (i.e. a corporate environment with a locked down OS image) then I'd suggest you look at building an installer and deal with pulling down the pre-requisites as appropriate. (WiX is my recommended way of doing that).

http://wix.sourceforge.net/

And WiX questions are tagged here on SO...

https://stackoverflow.com/tags/wix/

like image 69
Martin Peck Avatar answered Dec 07 '22 14:12

Martin Peck


Windows 7 comes preinstalled with .NET 3.5.1 which includes 3.5 SP1, so unless you need features of .NET 4 it should work just fine.

like image 38
Matt Greer Avatar answered Dec 07 '22 13:12

Matt Greer