I have an ASP.NET application that targets .NET Framework 4.7.2. I want to add a class library to it. When I try this, the only project-type option I see that looks anything like what I want is a Razor Class Library. If I choose this, the only choices for .NET are Core 3.1, Core 2.1 and , .NET5 (current).
If I choose the last one, it builds but includes some stuff that seems to be aimed at getting one version of .NET to work with another (e.g. Microsoft.AspNetCore.Components.Web
).
What I have tried:
The only other option is to create the library as an ASP.NET Web Application, which does allow me to choose .NET 4.7.2, to match the main project, but it seems wrong to create a whole web application when all I want is a library.
What is the right way to create a POCO library for an ASP.NET application?
(Note: I'd like to make the move to .NET Core as this is a new application but this is not currently supported by my web provider.)