I have an ASP.NET MVC application that I am converting to ASP.NET Core.
It is composed of many base libraries and one library that provides the top-level Program.cs
entry point.
I cannot set Microsoft.NET.Sdk.Web
as the project type for my base libraries on the Microsoft.AspNet.Core
framework, because then the compiler will error out with CS5001 Program does not contain a static 'Main' method suitable for an entry point
. And of course, the base libraries should not be the ones to define an entry point.
The reason why this is a problem is because I can't find a way to reference a specific package from the ASP.NET Core framework (in my example, Microsoft.AspNetCore.StaticFiles
) without declaring the project file as <Project Sdk="Microsoft.NET.Sdk.Web">
. The version of this package on NuGet is outdated.
What is the correct way to reference the .NET 7.0 version of the Microsoft.AspNetCore.StaticFiles
package?