alex
alex

Reputation: 43

Running a c# project on 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?

Upvotes: 4

Views: 202

Answers (4)

Ivan Prikhach
Ivan Prikhach

Reputation: 21

Windows 7 ships with .Net 3.5, so, if you this .net version or lower, your application should be able to run on any Windows 7 installation

Upvotes: 2

Martin Peck
Martin Peck

Reputation: 11544

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/

Upvotes: 8

Jeff LaFay
Jeff LaFay

Reputation: 13350

You need the appropriate .Net framework installed to match what your C# program was written with. If you don't have the correct framework, download it from microsoft.com.

Upvotes: 1

Matt Greer
Matt Greer

Reputation: 62027

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.

Upvotes: 5

Related Questions