完整的 .NET Framework 上的 ASP.NET Core 2.1

ASP.NET Core 2.1 on full .NET Framework(完整的 .NET Framework 上的 ASP.NET Core 2.1)
本文介绍了完整的 .NET Framework 上的 ASP.NET Core 2.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在使用 ASP.NET Core 2.1 的同时仍然在完整的 .NET Framework 4.7.1 上运行?

Is it possible to use ASP.NET Core 2.1 and still run on the full .NET Framework 4.7.1?

我目前在 .NET 4.7.1 上使用 ASP.NET Core 2.0,我还在 4.7.1 上使用 Azure Functions v1,并在 Functions 和 Web 项目之间共享类库.

I'm currently using ASP.NET Core 2.0 on .NET 4.7.1 and i'm also using Azure Functions v1 on 4.7.1 and share Class Librarys between the Functions- and the Web Projects.

考虑到 Azure Functions v2 的当前状态,升级到 Azure Functions v2 以全面使用 .NET Core 似乎有点太冒险了,所以我现在更愿意继续使用 .NET Framework.

Upgrading to Azure Functions v2 to go all-in on .NET Core seems a bit too risky given the current state of Azure Functions v2 so i would prefer staying on .NET Framework for now.

推荐答案

是的.

元包 Microsoft.AspNetCore.AppMicrosoft.AspNetCore.All 需要 netcoreapp,但它们只是其他包的集合安装.

The metapackages Microsoft.AspNetCore.App and Microsoft.AspNetCore.All require netcoreapp, but the they are just a collection of other packages to install.

如果您在元包中安装单个包,它会正常工作,就像您目前使用 2.0 一样

If you install the individual packages in the metapackage, it'll work fine, just like you currently have with 2.0

您的 .csproj 文件最终将与此类似...

Your .csproj file will end up looking similar to this...

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net471</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Folder Include="wwwroot" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="2.1.1" />
    <PackageReference Include="Microsoft.AspNetCore" Version="2.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="2.1.1" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.1.1" />
    ...

请注意一些软件包,例如.Microsoft.AspNetCore.Http.Connections 标记为 2.1.1,因此您需要确保匹配元包约束中的版本.

Just notice that some packages, eg. Microsoft.AspNetCore.Http.Connections are not tagged to 2.1.1, so you need to make sure you match the versions from the metapackage constraints.

这篇关于完整的 .NET Framework 上的 ASP.NET Core 2.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)