【问题标题】:How to use .NET framework 4.6 with Azure Websites?如何将 .NET 框架 4.6 与 Azure 网站一起使用?
【发布时间】:2015-07-22 10:42:59
【问题描述】:

.NET 框架 4.6 发布。我已经迁移了我的应用程序,但是当我部署到 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.

有什么方法可以安装或捆绑这个版本吗?

【问题讨论】:

  • 不,还不支持...
  • @Bidou:我们知道什么时候支持吗?
  • 我没有找到这个信息...如果有人知道答案,我也很感兴趣...
  • @Lanorkin 这是很好的信息,谢谢,但也请记住,这是已发布的 .NET 4.6 中的一个错误。修复该错误并不意味着 Azure Web Apps 将立即跟进。 Azure 上的版本可能会更早到来;但是,请在此处阅读这篇文章(尤其是建议):blogs.msdn.com/b/dotnet/archive/2015/07/28/… 了解微软对这种情况的看法。

标签: .net azure


【解决方案1】:

更新:

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

更新(2015 年 8 月 14 日)- 我们很高兴地宣布 .NET Framework 4.6 已推广到 Azure 应用服务。因此,Web App 开发人员现在可以构建运行 .NET Framework 4.6 的 ASP.NET 应用程序并将其部署到 Azure Web Apps。

过时的原始答案:

根据 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

“Azure Web 应用程序可用性

随着 ASP.NET 4.6 的全新发布,Azure Web Apps 服务仍在为这一重要更新做好准备和测试。一旦我们确认 Azure Web Apps 可以托管 ASP.NET 4.6 应用程序,其性能和保真度与您对 Microsoft Azure 的期望相同,我们将宣布该服务的兼容性。我们的运营团队正在努力工作,我们将在不久的将来在 Microsoft Azure 博客上更新您的信息。”

【讨论】:

  • 最新的博文(从 2015 年 8 月 11 日开始)说他们希望在本月的某个时候推出它:azure.microsoft.com/blog/2015/08/11/…
  • 对于那些对这个答案投反对票的人......考虑到它是在 7 月 22 日得到回答的......当这个问题被问到时。是的...4.6 更新已经完成...四个星期后这是正确的答案。
【解决方案2】:

MSDN 论坛上的Per David Ebbo,现在支持 4.6。

4.6 更新现已完成。尽情享受吧!

请注意,Azure 门户仍然显示 4.5,并且很快就会更新。 但这只是一个字符串更新,而 4.5 真的意味着 4.6。

如果不正确的字符串困扰您并且您确实想确定。您可以通过打开 Kudu 并导航到 D:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework 来验证它,以查看可用的版本。欲了解更多信息,请参阅here

【讨论】:

    【解决方案3】:

    据此,截至 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/

    更新(2015 年 8 月 14 日)——我们很高兴地宣布 .NET Framework 4.6 已推广到 Azure 应用服务。因此,Web App 开发人员现在可以构建和部署运行 .NET Framework 的 ASP.NET 应用程序 4.6 到 Azure Web 应用程序。

    【讨论】:

      【解决方案4】:

      如果您绑定到 .NET 4.6,则可以创建一个 Azure VM(在新门户中单击新建 | 计算 | Windows Server 2012 R2 并继续操作 - 在旧门户中,它被称为“虚拟机”!)然后将 .NET 4.6 安装到该服务器。

      然后您可以将您的 .NET 4.6 网站部署到该虚拟机。

      Azure Web 应用程序需要更多的工作和管理(而且比这个答案可能暗示的要多),但如果需要的话,它会让你使用 4.6。

      【讨论】:

      • 但请记住@Lanorkin 在他对上述原始问题的评论中强调的错误以及 Stackoverlow 的 Nick Craver 和 Mark Gravell 已向 MS 报告但您可能想先阅读此页面(尤其是建议):blogs.msdn.com/b/dotnet/archive/2015/07/28/…
      猜你喜欢
      • 1970-01-01
      • 2017-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-15
      • 2017-12-28
      • 1970-01-01
      相关资源
      最近更新 更多