Question: My Azure services target .Net 4.5.2 and run fine in dev. However, build produces the warning(s): 

> 
> Warning The project 'SurfInfoWeb' targets .NET Framework 4.5.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.
> 
> 
> 

I believe these (local) warnings are causing the publish to fail immediately (and these are the ONLY warnings in the error list).

According to MS, 4.5.2 is supposed to be available in January 2016 (I'm not sure exactly what date, but I thought I had read Jan 12 or Jan 16).

I can't suppress these warnings in the normal way because they don't have warning codes.

1) Is .Net 4.5.2 actually available on Azure

2) Is there a way to suppress warnings that don't have codes?

3) Something else I'm not thinking of?

I'm using SDK 2.8.1. And OSVersion="\*".

Answer: 
Based on the comments provided here - <https://azure.microsoft.com/en-in/documentation/articles/cloud-services-dotnet-install-dotnet/>, there's no way to suppress this warning.

[![enter image description here](https://i.stack.imgur.com/Mnr6a.png)](https://i.stack.imgur.com/Mnr6a.png)

> 
> Is .Net 4.5.2 actually available on Azure?
> 
> 
> 

As of today, yes. .Net 4.5.2 is available on Azure. In fact, we ported our solution from .Net 4.5 to .Net 4.5.2 just a few days ago.

In order to make use of .Net 4.5.2, you can't use "\*" for osVersion. You would need to target a specific OS version. Please see the Guest OS/Target Framework version matrix here: <https://azure.microsoft.com/en-in/documentation/articles/cloud-services-guestos-update-matrix/>.

Our solution makes use of osFamily 4 and based on this matrix, we ended up using `WA-GUEST-OS-4.26_201511-02` osVersion. Here's how our service configuration file looks like:

```
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="ServiceName" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="WA-GUEST-OS-4.26_201511-02" schemaVersion="2015-04.2.6">
  <Role name="RoleName">
  </Role>
</ServiceConfiguration>

```
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.)