Hacker News new | ask | show | jobs
by JamesNK 2143 days ago
It is strange that you couldn't find the empty web template. Every version of ASP.NET Core has come with one. Empty is the first option in the "Create a new ASP.NET Core web application" dialog in VS2019, and "dotnet new web" creates an empty website via the command line.

What did you need to do to create an empty website?

Disclaimer: I work on ASP.NET Core

1 comments

The most minimalist ASP.NET Core template I could find made it too difficult to create a "page" with some code-behind.

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.

> The most minimalist ASP.NET Core template I could find made it too difficult to create a "page" with some code-behind.

The minimalist projects don't do "code-behind" at all.

"self-evident which framework I'm "in" for any given project"

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