I get a similar version of this error, essentially a new version:
Microsoft Azure Cloud Service projects only support roles that work in the .NET Framework versions 4.0, 4.5, and 4.6. Set the Target Framework property in the project settings for the MyWorkerRole project to .NET Framework 4.0, .NET Framework 4.5 or .NET Framework 4.6.
And
The MyWorkerRole project is for the .NET Framework 4.7.2. To ensure that the role starts, this version of the .NET Framework must be installed on the virtual machine for this role. You can use the launch task to install the required version if it is not already installed as part of the Microsoft Azure guest OS. For more information, see https://go.microsoft.com/fwlink/?LinkId=309796 .
Even after following the instructions provided in the link in the message (which were useful when creating installer scripts, etc.), the warning message did not disappear. I tried all kinds of things, including groups of framework elements, all properties, etc.
I eventually included the assembly in Detailed output, figured out the .targets file it came from, and checked it. βI found that there is simply no built-in way to suppress it.β
HOWEVER, there is a hack that you can do - I basically copied this block from the .targets file to my .ccproj file and deleted the warning part. Essentially, I added the following to the end of my .ccproj and BADAO file! Likewise, 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 this INSIDE <Project/> , of course.)