What is the Target Framework and what is it for?

Asked

Viewed 649 times

11

I work for a while with .NET and I was asked about the target framework of my projects.

Target framework

I understand what it’s for but I couldn’t explain it simple and clear what exactly is.

3 answers

15


Examples:

.NET Framework 2.0: You will have the features present in version 2.0 of . NET and in the computers "clients", you will need to have . NET 2.0 installed.

.NET Framework 4.6.1: You will have the features present in version 4.6.1 of . NET and in the computers "clients", you will need to have . NET 4.6.1 installed.

If you are working with LINQ for example, this feature is only available from version 3.5. NET, in previous versions, it will not be possible to develop using LINQ. There are several other features that are inserted or discontinued at each update, usually maintaining backward compatibility. I believe that the ideal is always to prefer the most current, unless you have any specific requirement.

Situations that happen when publishing an application:

1- Develop with . NET 2.0 and run on a Windows XP SP2 < Windows 8: Application Run natively, since these S.O. already have the framework installed.

On Windows 8 or higher machines, package installation will be required. Net 2.0 and 3.5 by Control Panel > add or remove windows features.

2- Develop with . NET 4, to run on older versions of windows, it will be necessary to install the package by the installer published by microsoft, checking the compatibility with S.O. In the most current versions (8 to 10) the application will run natively.

  • 2

    mass, I think I can already explain what :P was worth

12

There are several versions of frameworks as can be seen on the screen. Actually there is much more than these, since there is not only . NET Framework, there is, the . NET Core, the . NET Native, Xamarin, Mono, . NET Micro Framework, among others. Of course you can only use what is installed on your machine. Of course in the case of . NET Framework this is most important because it works as a complete own platform and needs to have installed on the user’s machine.

The moment you generate the binaries of your application it is important to indicate which version you want to use for it to configure everything correctly and to analyze if you can sweat everything you want. Then if you indicate that you will use an older version, you will not have access to the features of the newer versions. If you indicate that you will use a newer version your application will only run on machines that have that version of . NET, even if you have not used anything specific to it. Of course the appropriate installer will do the upgrade from . NET to you if necessary.

If I’m not mistaken only version 3.5 is still officially supported, the previous ones exist by compatibility. Particularly always prefer the most current version which is the 4.7.

  • 1

    good explanation, thank you.

  • Is it possible to develop without . net framework ? I think it is impossible

  • @Matheusmiranda yes, it is possible https://answall.com/q/227301/101. I am on a provisional machine and no VS for screen copying with others targets.

7

When you target a framework in an app or library, you’re specifying the set of Apis that you’d like to make available to the app or library. You specify the target framework in your project file using Target Framework Monikers (Tfms).

From what I understand at that link If you understand a little English, is that the target framework "points" which version your app or library will be available (compatibility). This includes programming language features and development patterns

Browser other questions tagged

You are not signed in. Login or sign up in order to post.