Should I compile my application to the latest .NET Framework even if I'm not using any new features?
I've develo开发者_开发技巧ped an application using Visual Studio 2010, which by default compiles to the .NET Framework 4. However, as far as I'm aware, my application is not using any .NET 4 specific features and would probably work fine compiled to 3/3.5 or even 2. The main problem I see with compiling to v4 is that many users won't have the v4 framework installed and so will need to go through the process of downloading and installing it. Is there any performance/security/etc benefits to running the same code compiled to v4 rather than previous versions which would justify using v4, or should I just use the older versions until I need the new features found in 4?
Amr
If you don't use any .NET 4.0 specific features then probably you would be better of compiling against an older version of the framework. If the user has only .NET 4.0 installed your program would still run whereas if you compile against .NET 4.0 and the user doesn't have it installed it won't run.
To be honest I think I would actually go the other way, use .Net 4.0 anyway. This gives you the ability to use the new features should they become relevant to what you are doing. More and more users will now be getting .Net4 as more apps use it so you may as well be there anyway.
I'd say it all depends on your deployment environment. If your users have .NET 4, move forward. If your environment is a couple of version or two back, you will probably be best to hold off.
Unless you are deploying for the masses, you should know what environment you users will have.
You say:
released one beta version of the program so far
If you don't go to .NET v4 now, will it be harder to get users to allow you to move to .NET 4 later? I tend to find it is best to start of on the latest system with a new product, as there will always be some users that it make hard for you to move on later, so buy yourself as much time as you can at the start.
精彩评论