First I'll start by saying that this question is similar to this question: Cannot use msdeploy to sync 2 websites - ERROR_FRAMEWORK_VERSIONS_DO_NOT_MATCH.
Actually my use case is different... but despite that I still tried to get the big picture and follow the answers there. However it didn't work...
Let me explain.
In my case I am trying to migrate a website running on IIS 7.5 and Windows Server 2008 to another machine running IIS 10 and Windows Server 2016.
I found a good detailed tutorial called Steps to migrate the websites from IIS 7.5 to IIS 10 which matched my situation perfectly and I followed it carefully, installing all the required roles and features on the new server and Web Deploy 3.6 on both servers (which integrated correctly on both IIS Managers, adding the "Deploy" options to the context menu).
So I then successfully managed to export the website, but when I tried importing it in IIS 10, the import operation halted with this error:
The version of the .NET Framework Configuration Provider (machineConfig64) are different on the source (2.0) and destination (4.0).
Now, I did read the above documentation page and also a different article at: https://blogs.msdn.microsoft.com/ericparvin/2015/04/03/error_framework_versions_do_not_match/
and as advised I tried inverting the position of
<supportedRuntime version="v2.0.50727" /> <supportedRuntime version="v4.0" />
both in msdeploy.exe.config and msdepsvc.exe.config, on both the origin and destination server, and also restarted the wmsvc service.
However no matter which combination of changes I try, I still get the same error message.
I also exported the website again after applying those changes, but importing failed again with the same error.
Now, I have to admit that I am not really sure I got this all under my belt... Both the official and unofficial documentation articles never make clear if you have to edit the origin or destination msdeploy.exe.config and msdepsvc.exe.config. It's all given for granted! Moreover for some reason Microsoft decided that they had to use the words "client" and "server", and it's never clear when those refer to the origin server and destination server!
So the only thing I could do is make a change here, restart service, see if works, make a change there, restart service, see if it works... and so on... until I got more and more confused and frustrated.
And another thing that is making me go crazy is that the origin website uses a .NET Framework 4.0 Classic application pool, yet the error complains that the origin is on .NET 2.0. ??? How is that?
Well, I'd really appreciate if somebody could give me a little guidance into understanding what I am doing wrong and how I could fix it... Thanks a lot in advance!