I'm getting a similar version of this error, essentially, the new version of it:
Microsoft Azure Cloud Service projects only support roles that run on
.NET Framework versions 4.0,
4.5 and 4.6. Please set the Target Framework property in the project settings for project 'MyWorkerRole' to .NET Framework 4.0, .NET
Framework 4.5 or .NET Framework 4.6.
And
The project 'MyWorkerRole' targets .NET Framework 4.7.2. To make sure
that the role starts, this version of the .NET Framework must be
installed on the virtual machine for this role. You can use a startup
task to install the required version, if it is not already installed
as part of the Microsoft Azure guest OS. For more details, see
https://go.microsoft.com/fwlink/?LinkId=309796.
Even after following the directions located at the link in the message (which were helpful in creating the installer scripts, etc.), the warning message did not go away. I tried all sorts of stuff including the framework moniker item groups, all kinds of properties, etc.
Ultimately, I ended up turning my build on Detailed
output, figured out the .targets file this was coming from and inspected it. -- I found that there is just no built-in way to suppress it.
HOWEVER, there is a hack you can do -- I basically copied that block from the .targets file into my .ccproj file, and removed the part about the warning. Basically I added the following to the end of my .ccproj file, and BADAO!, just like that NO MORE WARNINGS!:
<Target Name="ValidateRoleTargetFramework"
Outputs="%(RoleReference.Identity)"
Condition="'@(RoleReference)' != ''">
<PropertyGroup>
<_RoleTargetFramework>%(RoleReference.RoleTargetFramework)</_RoleTargetFramework>
<_IsValidRoleTargetFramework>False</_IsValidRoleTargetFramework>
<_IsValidRoleTargetFramework
Condition="$(_RoleTargetFramework.StartsWith('v4.0')) Or $(_RoleTargetFramework.StartsWith('v4.5')) Or $(_RoleTargetFramework.StartsWith('v4.6'))">True</_IsValidRoleTargetFramework>
</PropertyGroup>
</Target>
(Obviously, you should put that INSIDE your <Project />
tag, of course.)