I have a web project that I'm trying to convert to Microsoft.NET.Sdk.Web. When I make the change to the .csproj file, though, it seems to force it to be interpreted as a <PackageReference>
-based project. Of course, <PackageReference>
isn't supported in web projects, because it doesn't support persisting the results of installing a package. Web projects must use packages.config
in order to support NuGet packages that inject static content into the site's space (such as NewRelic). But, after switching to Microsoft.NET.Sdk.Web
, the build system seems absolutely stuck on the project being <PackageReference>
-based. How do I resolve this? Surely the very existence of Microsoft.NET.Sdk.Web
implies that it is possible to use packages.config
with an SDK project. But, even if I set <RestoreProjectStyle>Packages.config</RestoreProjectStyle>
, it still thinks the project is <PackageReference>
-based. I've seen advice to try running Update-Package -Reinstall
after clearing out obj
, bin
and .vs
, but nothing I've tried has convinced it that this is not a <PackageReference>
-based project:
In Visual Studio, all of the NuGet-inserted references are lumped in with other references under Dependencies\Assemblies, and the "Installed" tab of the NuGet Package Manager is empty.
What do I do?
Microsoft.NET.Sdk.Web
is meant to be used for ASP.NET Core and all the ASP.NET Core templates and projects I know usePackageReference
, notpackages.config
- but maybe you find a counterexample 😉 – HerracontentFiles
(see here) – Herra