I use Azure to host a cloud service, and I updated my code to target the .NET 4.5.2 Framework. When I published it, things went kablooey:
The 'targetFramework' attribute in the element of the Web.config file is used only to target version 4.0 and later of the .NET Framework (for example, ''). The 'targetFramework' attribute currently references a version that is later than the installed version of the .NET Framework. Specify a valid target version of the .NET Framework, or install the required version of the .NET Framework.
The yellow screen of death threw up here:
compilation strict="false" explicit="true" targetFramework="4.5.2"
So I'm confused here because I don't NEED to target 4.5.2 for any special features in my code, but 4.5 seems "old". Am I using cloud services wrong here? Is there a problem for me to continue using 4.5? OR should I go through some steps to have 4.5.2 available when I publish my code?
The reason you're getting this error is because .Net Framework 4.5.2 is not installed on your Cloud Service Virtual Machines by default. This is something that Microsoft is planning on doing very shortly (based on the email sent out by Microsoft earlier this week).
From that email:
On August 7, 2014, Microsoft announced that support will end for .NET
Framework 4, 4.5, and 4.5.1 on January 12, 2016. It is recommended
that customers and developers complete the in-place update to .NET
Framework 4.5.2 by January 12, 2016 to continue receiving technical
support and security updates. Visit Microsoft .NET Framework Support
Lifecycle Policy for more details. On October 27, we announced
that, Azure will update the .NET Framework in Windows Azure Guest
operating system (Guest OS) family 2.x, 3.x and 4.x to .NET Framework
4.5.2 in the upcoming November Guest OS Release. Since then, we have received customers’ feedback to postpone the automatic update to an OS
release with .NET 4.5.2 and provide an image with .NET 4.5.2 for test
validation.
To better accommodate customers’ requirements and provide a smooth
upgrade to .NET 4.5.2, Azure will update the .NET Framework in Windows
Azure Guest operating system (Guest OS) family 2.x, 3.x and 4.x to
.NET Framework 4.5.2 in the January 2016 Guest OS Release. Cloud
services running on Guest OS family 2.x, 3.x and 4.x with automatic
updates enabled will be updated to the January 2016 Guest OS with .NET
Framework 4.5.2. In November, the .NET Framework installed in the
default OS will not be changed. In order to help customers validate
their cloud service with .NET 4.5.2, Azure will provide a second set
of November OS Versions 201511-02 for with .NET 4.5.2 for manual
deployment.
To manually install .Net Framework 4.5.2 in your Cloud Service, you may find this link helpful: https://azure.microsoft.com/en-us/documentation/articles/cloud-services-dotnet-install-dotnet.
In case it helps anyone. I had the same issue and my fix was to update the OS from Windows Server 2012 to the latest OS (Currently Windows Server 2016) for the cloud service which fixed the problem.
Related
I have this issue in which I'm currently targeting .NET Framework 4.7.2 in my solution but the Azure Web App Service only supports up to .NET Framework 4.7.1. So, my question is this: As long as I only use 4.7.1 features, should it work without issue on the Azure Web App Service (which only supports up to 4.7.1) even though I'm targeting 4.7.2? Are the .NET Frameworks backwards compatible? So far, I haven't seen any issues. I just want to make sure there will be no future complications. Ideally, I would like to keep targeting 4.7.2 so that I can start using the 4.7.2 features once it becomes available on Azure Web App Service.
The .NET Framework 4.7.2 builds on previous versions of the .NET Framework 4.x by adding many new fixes and several new features while remaining a very stable product.
The .NET Framework 4.7.2 is included with the Windows 10 April 2018 Update
The .NET Framework 4.7.2 can be used to run applications built for the .NET Framework 4.0 through 4.7.1.
Azure App Service now supports 4.7.2
I think that you did a good thing in upgrading and targeting .NET Framework 4.7.2 ; I also have an Azure App Service and upgraded it to 4.7.2 and it is running very well. As said before, it brings updates and fixes, and it is backward compatible on almost all cases.
Note that the recommended is that the target machine have a .Net version Equal or Greater of the of the .NET Framework 4.x than your compiled version.
See:
https://learn.microsoft.com/en-us/dotnet/framework/whats-new/index#v472
https://learn.microsoft.com/en-us/dotnet/framework/install/on-windows-10
#TheDude, you cannot build an app on 4.7.2 and hope to run it on lower version like 4.7.1. At runtime the target framework version check will fail as it will find the Framework version (4.7.2) as missing.
The other way round (i.e. target 4.7.1 and run on 4.7.2) is fine as the higher versions are backwards compatible.
The documentation about Linux hosting only mentions mono. Can the new .net core and asp.net core (DNX) also be used?
ServiceStack now supports running on .NET Core from October 20, 2016 v4.5.2 Release.
Nearly all of ServiceStack’s features are now available across 21 of our most popular NuGet packages, inc. OrmLite support for SQL Server, PostgreSQL and Sqlite. We’ve been able to achieve excellent integration and code-reuse where your ServiceStack AppHost can be registered as a .NET Core module and most of your Service Implementation using ServiceStack libraries remains unchanged.
We’ve ported a number of existing Live Demos to .NET Core providing example projects so you can easily compare .NET 4.5 ServiceStack code-bases with what it looks like in .NET Core at:
https://github.com/NetCoreApps/LiveDemos
All .NET Core Live Demos are running on Linux / Docker using AWS ECS Container Service.
We’re maintaining .NET Core packages isolated from the Main NuGet packages separated with a .Core suffix until we’re satisfied .NET Core has been battle-tested in the wild which will enable us to make frequent releases outside of the main .NET 4.5 release cycle.
Please see the full v4.5.2 Release Notes for details on running ServiceStack on .NET Core, its integration story and the different conventions in .NET Core.
I am stuck on creating azure batch pool with .net 4.6.1.
I went through those very good resources:
Compute Node - Install .NET 4.6.1
How to get the Windows 2016 Preview OS
and I found out that there is a way to use .net 4.6.1 without installing it manually on a node. There is a programmatic way to set up Windows Ghost image with the latest .net version which is .net 4.6.1 but my node is defined in advance.
I need to have .net 4.6.1 because we use Data Factory and custom activities which are run on azure batch nodes. We upgraded .net version manually on that node but Microsoft doesn't guarantee that the state will preserve and we noticed a few times that node was reset to its original state.
My questions are:
do you know if there is any way on azure portal to choose OS family set to Windows Server 2016 with installed .net 4.6.1 version already?
does anybody know when there will be any os with .net 4.6.1 available?
or should I go with StartTask feature and try to install .net 4.6.1 manually? However, that option sounds like some workaround and not the correct solution.
There is not. They have said that when server 2016 releases on azure, it will be available on batch. Until then, the 4.6.1 install as a startup task is your only option. They also will, at some point, allow us to use custom images, rather than their pre-made images.
Updated 2016-02-07:
You can now deploy OS Family 5 under Cloud Services Configuration in Azure Batch, which is equivalent to Windows Server 2016 (as Marketplace/VM image).
Previous answer:
Answers to your questions:
do you know if there is any way on azure portal to choose OS family set to Windows Server 2016 with installed .net 4.6.1 version already?
Yes, you can change the "Image Type" to Marketplace and select 2016-Datacenter which is Windows Server 2016.
does anybody know when there will be any os with .net 4.6.1 available?
As per above, it's available now for Marketplace (IaaS) under 2016-Datacenter. The Batch team is currently working to support OS Family 5 as a guest OS for Cloud Services.
or should I go with StartTask feature and try to install .net 4.6.1 manually? However, that option sounds like some workaround and not the correct solution.
You can always install it as part of a start task and is considered the proper solution for Azure Batch proper for compute nodes with Windows Server < 2016.
You will still have to use the StartTask to install .NET 4.6.1. In the first resource you mentioned, there's a small piece of code that checks the current .NET installation and installs+reboots if needed.
If possible, downgrade your application's .NET version to 4.5.2 to save the hassle of restarting the node.
I am very confused. I had the 1.6 library and then upgraded to 1.7.
Now I see the following:
Windows Azure SDK for Windows 8 and .NET 4(2.0.0.0)
Is this the latest library and is it just for Windows 8? I'm sorry but it's not very clear. When I try to download that it takes me to a web page with a link to download and no application. When I try for help it points me to stackoverflow.
Windows Azure SDK for Windows 8 and .NET 4 (2.0.0.0)
is probably
October 2012 Release (Version 1.8)
which is the latest release as of now (2012-12-04).
The version scheme changed a bit (e.g. storage client dll is now 2.0 because of breaking changes) while other parts remain unchanged/compatible (1.7/1.8) (see Windows Azure SDK and Tools).
The azure SDKs/client libraries should not depend on Windows 8.
You can find all downloads at windowsazure.com
Is there any IIS version release after IIS 7.5?
And is there any update for .NetFramework released after .NetFramework 4?
IIS is considered part of the operating system, so probably IIS vNext will only come when Microsoft releases its next version of Windows, which may not happen in the coming months. But once Microsoft provides public betas of it, you can test it out.
.NET 4 is still the latest, and like #Pawan pointed out, there are updates for .NET already, but SP1 is not yet announced.