简体   繁体   English

如何在Azure网站上使用.NET framework 4.6?

[英]How to use .NET framework 4.6 with Azure Websites?

The .NET framework 4.6 is released. .NET框架4.6已发布。 I've migrated my application but when I deploy to an Azure Website I get the following error: 我已经迁移了我的应用程序但是当我部署到Azure网站时,我收到以下错误:

D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

Is there any way to install or bundle this with a release? 有没有办法在发布时安装或捆绑它?

Update: 更新:

https://azure.microsoft.com/en-us/blog/update-on-net-framework-4-6-and-azure/ https://azure.microsoft.com/en-us/blog/update-on-net-framework-4-6-and-azure/

Update (August 14, 2015) - We're happy to announce that .NET Framework 4.6 has been rolled out to Azure App Service. 更新(2015年8月14日) - 我们很高兴地宣布.NET Framework 4.6已经推广到Azure App Service。 So Web App developers can now build and deploy ASP.NET applications running .NET Framework 4.6 to Azure Web Apps. 因此,Web App开发人员现在可以构建和部署运行.NET Framework 4.6的ASP.NET应用程序到Azure Web Apps。

OUTDATED Original Answer: 已过时原始答案:

According to the following blog post on MSDN: 根据MSDN上的以下博客文章:

http://blogs.msdn.com/b/webdev/archive/2015/07/20/announcing-asp-net-4-6-and-asp-net-5-beta-5-in-visual-studio-2015-release.aspx#pub46Hosting http://blogs.msdn.com/b/webdev/archive/2015/07/20/announcing-asp-net-4-6-and-asp-net-5-beta-5-in-visual-studio- 2015年,release.aspx#pub46Hosting

"Azure Web Apps Availability “Azure Web Apps可用性

With the brand-new release of ASP.NET 4.6, the Azure Web Apps service is still being prepared and tested for this important update. 随着ASP.NET 4.6的全新版本,Azure Web Apps服务仍在为这一重要更新做准备和测试。 Once we have confirmed that Azure Web Apps can host an ASP.NET 4.6 application with the same high level of performance and fidelity that you expect from Microsoft Azure, we will announce compatibility of the service. 一旦我们确认Azure Web Apps可以托管具有与Microsoft Azure相同的高性能和保真度的ASP.NET 4.6应用程序,我们将宣布该服务的兼容性。 Our operations team is working diligently and we will update you on the Microsoft Azure blog in the near future." 我们的运营团队正在努力工作,我们将在不久的将来在Microsoft Azure博客上为您更新。“

Per David Ebbo on the MSDN Forums, 4.6 is now supported. 在MSDN论坛上, Per David Ebbo现在支持4.6。

The 4.6 update is now complete. 4.6更新现已完成。 Enjoy! 请享用!

Note that the Azure Portal still says 4.5, and will soon be updated. 请注意,Azure门户仍然会说4.5,并且很快就会更新。 But that's just a string update, and 4.5 really means 4.6. 但这只是一个字符串更新,4.5真的意味着4.6。

If the incorrect string bothers you and you really want to know for sure. 如果不正确的字符串困扰你,你真的想知道。 You can verify it by opening Kudu and navigating to D:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework to see what versions are available. 您可以通过打开Kudu并导航到D:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework来验证它,以查看可用的版本。 For more info see here . 有关详情,请参阅此处

As of August 14th, .NET 4.6 is officially supported on Azure Websites (Azure Web Apps), according to this... 截至8月14日,Azure网站(Azure Web Apps)正式支持.NET 4.6,据此...

https://azure.microsoft.com/blog/2015/08/11/update-on-net-framework-4-6-and-azure/ https://azure.microsoft.com/blog/2015/08/11/update-on-net-framework-4-6-and-azure/

Update (August 14, 2015) – We're happy to announce that .NET Framework 4.6 has been rolled out to Azure App Service. 更新(2015年8月14日) - 我们很高兴地宣布.NET Framework 4.6已经推广到Azure App Service。 So Web App developers can now build and deploy ASP.NET applications running .NET Framework 4.6 to Azure Web Apps. 因此,Web App开发人员现在可以构建和部署运行.NET Framework 4.6的ASP.NET应用程序到Azure Web Apps。

If you are tied to .NET 4.6, you can create an Azure VM (in the new portal click New | Compute | Windows Server 2012 R2 and follow on through - in old portal it is helpfully called "Virtual Machines"!) and then install .NET 4.6 to that server. 如果您与.NET 4.6绑定,则可以创建Azure VM(在新门户中单击“新建”|“计算”|“Windows Server 2012 R2”并继续执行 - 在旧门户中,它有助于称为“虚拟机”!)然后安装.NET 4.6到该服务器。

You can then deploy your .NET 4.6 website to that Virtual Machine. 然后,您可以将.NET 4.6网站部署到该虚拟机。

It is more work and admin that an Azure Web App (and than this answer might imply) but it will get you live with 4.6 if needs be. Azure Web App(而不是这个答案可能意味着)是更多的工作和管理员,但如果需要,它将让你获得4.6。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM