Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core 2.1 on full .NET Framework

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

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.

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.

like image 545
Markus Strobl Avatar asked Jun 27 '18 15:06

Markus Strobl


People also ask

Can ASP.NET Core work with the .NET framework?

In order to run ASP.NET Core Apps on the . NET Framework it needs to only reference . Core NuGet packages which contains only the . NET Standard 2.0 builds.

Is .NET Core 2.1 supported?

Microsoft will end support of the . NET Core 2.1 open source development platform on August 21, 2021, which could raise security concerns for those running the platform beyond that date. Beginning September 2021, security updates will be issued for .

Is NET Core 2.2 backwards compatible?

NET Core apps are built/published/restored, they target a major release and feature set as indicated by the major/minor version numbers found in the runtime name. So, netcoreapp2. 2 is backwards compatible with netcoreapp2.

What is ASP Core 2 1?

ASP.NET Core 2.1 is an interesting release because it's the most recently supported ASP.NET Core release that supported both .NET Core and .NET Framework runtimes. As such, it may offer an easier upgrade path for some apps when compared to upgrading all parts of the app to .NET Core/.NET 6 at once.

Is it possible to run ASP NET Core + full framework?

With ASP.NET Core 1.0 release one can run on either .NET Core or the full .NET Framework per the documentation here. I'm trying to understand the latter option of why one would select ASP.NET Core + the full .NET Framework? I understand the difference between the full .NET Framework and .NET Core.

What is the latest release of ASP NET Core?

Today we're thrilled to announce the release of ASP.NET Core 2.1.0! This is the latest release of our open-source and cross-platform web framework for .NET and it's now ready for production use. Get started with ASP.NET Core 2.1 today! SignalR – Add real-time web capabilities to your ASP.NET Core apps.

How do I get Started with ASP NET Core?

You can Get started with ASP.NET Core 2.1 in 10 minutes by installing the latest .NET Core SDK and latest Visual Studio release. Then follow the tutorial instructions to create your first ASP.NET Core app.


1 Answers

Yes.

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

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

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" />
    ...

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.

like image 99
Doug Avatar answered Oct 19 '22 06:10

Doug