I wanted to write 1 page with just some dynamic labels, that's it. Nothing fancy. No MVC. No dependency injection. No JavaScript frameworks. No CSS. Just one ASPX or CSHTML page.
Visual Studio 2019 no longer ships with a web project template that does that. Every single project type coughs up megabytes of crap and a bunch of scaffolding.
After hours of clicking through every project type, I resorted to another hour of googling to discover that the "legacy" empty templates are still there, but only available as a hidden install option!
It's madness.
Yeah, the way depency injection and multiple JS frameworks are shoved down your throat in .NET Core is sooo annoying.
I've been using dotnet core for years and precisely zero times I have had any JS framework shoved down my throat.
What did you need to do to create an empty website?
Disclaimer: I work on ASP.NET Core
I could create a CSHTML page and inline expressions worked, but I couldn't convince it to execute anything from a matching cs class.
I did google this, and it's not like I hadn't written Razor syntax pages before, but that was a few years ago and my memory was fuzzy.
What I found was that Razor pages are now part of any number of very similar sounding but wildly different frameworks, and code samples for one do literally nothing in the other. It's not even self-evident which framework I'm "in" for any given project. Half of it seems to be just convention, the other half is explicit configuration, and it's all version specific.
I tried to go back to classic ASP.NET, thinking that that's actually a better fit for the type of legacy web app server testing that I need to do. That's where I found the new project templates that pull in more code by default into an "empty" project than I've written in the past half a decade.
Has that changed? It's in the project properties in Visual Studio where I think it's been for as long as I can remember?
NB I've been using .Net for about 15 years and quite happily using .Net Core 3.1
The minimalist projects don't do "code-behind" at all.
When run all it does is return "Hello World!" in plain text - it doesn't even use HTML.
dotnet new empty ?
With the new request handling pipeline you hardly need a template for a single page diagnostic.
https://anthonygiretti.com/2020/06/29/nano-services-with-asp...