Reputation: 338
I get the following warning so the publish of cloud service fails from Azure SDK 2.1.
Warning 1 The project 'WCFServiceSurferlite' targets .NET Framework 4.5.1. 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 Windows Azure guest OS. For more details, see http://go.microsoft.com/fwlink/?LinkId=309796.
I can't target to 4.5 because it is not available in Visual Studio 2013.
How can I solve this. Please Help.
Upvotes: 4
Views: 3974
Reputation: 61
Update - April 2 2014 - * Answering this question as it shows up as one of first results on popular engines, while searching for trying to install Microsoft .NET framework 4.5.1 on Azure Cloud service.
The easiest way would be to set osFamily attribute to "4" in the Cloud Service Configuration file (.cscfg file). This will bring up an instance of Windows Server 2012 R2 with Microsoft .NET framework 4.5.1 installed.
Example:
<ServiceConfiguration serviceName="CloudDeploymentShell" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" ...
Upvotes: 4
Reputation: 100
Here is a blog post from a guy who deployed 4.5 before it was avail in Azure. The same approach should work for 4.5.1. http://danieljsinclair.wordpress.com/2012/06/28/how-i-got-net-4-5-rc-running-in-a-windows-azure-webrole/
Upvotes: 2
Reputation: 10985
Visual Studio 2013 is in Beta/Preview. If you can't target 4.5 with it then you'll need to either drop back to VS 2012 for your work in Azure or see if you can install 4.5.1 on the role instances using a start up task just as the warning suggests.
As each new Visual Studio and .NET version comes out there is usually a lag before VS supports the Windows Azure tools and again a lag after the .NET version has shipped before it is baked into a Guest OS that you can use in Azure.
Upvotes: 1