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?
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?
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.
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:
I had do something similar when we went from 2.0 to 3.5 + VS2008. I did using awk(actually gawk). I was able to do the migration without have to freeze other developer checkins while I was converting.
awk allowed me to specify a series of RegEx patterns to look for in each file and execute an "action". The out-of-the box supported functions was on par with what I'm used to with vbscript.
I got gawk from here - http://unxutils.sourceforge.net/
I found this article helpful to learn - http://www.cs.utah.edu/dept/old/texinfo/gawk/gawk_toc.html
© 2022 - 2024 — McMap. All rights reserved.