In one big solution we have about 100~ projects all targeting 3.5 and currently in VS.NET 2010.
Now we want to upgrade it to .NET 4.0, do I have to go one by one and change their target? or is there any way to automate this process?
The Target Framework Migrator extension works great.
After you install it simply go to Tools
-> Target Framework Migrator
When upgrading many projects and similar operation I usually use Find and replace in files.
First I upgrade one project and diff the result, then I search and replace relevant parts in my .csproj files.
Yes. You will have to change them each to use .Net 4.0 .
Or you could make a script that changed all the project files' text and change the supported framework. But, it would take more time than just go trough them all and change them.
Just note that you don't have to do that. There's backwards compatibility.. projects compiled to work with .Net 3.5 will work with .Net 4.0
Only thing you really need to do is change the setup project to include .Net 4.0 as a prerequisite .
Other than that, you don't need to change the framework until you actually want to use something from the new framework.
I'm not sure about moving from 3.5 to 4.0, but in case you're upgrading from 2.0 to 4.0, you'll see that VS2010 actually added a default app.config file (in case you didn't have your own), which means that you'll also have to copy this file to each of the projects. Also, in case you have some *.designer files, those may change as well, so you'll have to update accordingly...
To summarize, here's the procedure:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With