Yes, as 4.7.2 is an in-place upgrade of .NET 4 without breaking changes (in areas we use) so it should be OK. It doesn't offer code generation for 4.7.2 (so the csproj files have e.g. 4.5.2 as .net version) so you have to change that in visual studio/rider after you've loaded the csproj files.
Not sure why you'd want to upgrade to 4.2 btw, it doesn't get any patches anymore. Latest version is v5.5 which has many more features and is quite a lot faster than 4.2