What can be risk if we compile our .NET project on framework 2.0 and deploying on framework 4.0

StackOverflow https://stackoverflow.com/questions/10426153

  •  05-06-2021
  •  | 
  •  

Question

I have got installed .NET 2.0 framework on my local machine where is my project and my webserver has got .NET framework 4.0 installed.

Please suggest what can be the risks or benefits if we go with this, as building the project on 2.0 and then deploying it on 4.0.

Thanks.

Was it helpful?

Solution

In general, .NET 4 will run .NET 2 applications fine. However, it is a different framework and a different CLR, so it is possible for results to be different.

If you know your deployment environment will be using .NET 4, I would recommend developing using .NET 4. This gives you improved features (lots of new stuff in .NET 4) as well as guarantees to the same environment in development as deployment.

Note that you can use Visual Web Developer Express (2010) for free to develop .NET 4 applications to match your webserver.

OTHER TIPS

You should only really do that as a transition; in general, you should attempt to mimic your deployment environment(s) as closely as possible during both development and testing, to avoid wasting your own time (and annoying your customer).

In most ways, it'll just work. However, chunks of the BCL have been tweaked over time, either to support new features or (more commonly) to bug-fix. If your code is inadvertently dependent on some side-effect of a bug, or if a new bug has been accidentally introduced then it could behave differently. This is especially true if you are reflecting inside the innards of BCL types.

Most likely, though, it'll be fine. You are going to have to test to have confidence.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top